Part Number Hot Search : 
ZN435J 01006 151K1 LC66308A 2W10G 60N10 C25005 KBJ10B
Product Description
Full Text Search
 

To Download MC68HCL05J1A Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 MC68HC05J1A MC68HCL05J1A MC68HSC05J1A
Technical Data
M68HC05
Microcontrollers
MC68HC05J1A/D Rev. 3, 4/2002
WWW.MOTOROLA.COM/SEMICONDUCTORS
MC68HC05J1A MC68HCL05J1A MC68HSC05J1A
Technical Data
To provide the most up-to-date information, the revision of our documents on the World Wide Web will be the most current. Your printed copy may be an earlier revision. To verify you have the latest information available, refer to: http://www.motorola.com/semiconductors/ The following revision history table summarizes changes contained in this document. For your convenience, the page number designators have been linked to the appropriate location.
Motorola and the Stylized M Logo are registered trademarks of Motorola, Inc. DigitalDNA is a trademark of Motorola, Inc.
(c) Motorola, Inc., 2002
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Technical Data 3
Technical Data
Revision History
Date Revision Level Description 10.5 Thermal Characteristics -- In table under Thermal resistance, device numbers corrected July, 2001 2.0 Section 12. Ordering Information -- Added Table 12-1. MC Order Numbers for clarity April, 2002 3.0 Update World Wide Web address 111 112 Page Number(s) 97
Technical Data 4
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Technical Data -- MC68HC05J1A
List of Sections
Section 1. General Description . . . . . . . . . . . . . . . . . . . . 17 Section 2. Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Section 3. Central Processor Unit (CPU) . . . . . . . . . . . . 33 Section 4. Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Section 5. Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Section 6. Low-Power Modes. . . . . . . . . . . . . . . . . . . . . . 55 Section 7. Parallel Input/Output (I/O). . . . . . . . . . . . . . . . 61 Section 8. Multifunction Timer. . . . . . . . . . . . . . . . . . . . . 71 Section 9. Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . 77 Section 10. Electrical Specifications. . . . . . . . . . . . . . . . 95 Section 11. Mechanical Specifications . . . . . . . . . . . . . 109 Section 12. Ordering Information . . . . . . . . . . . . . . . . . 111 Appendix A. MC68HCL05J1A. . . . . . . . . . . . . . . . . . . . . 117 Appendix B. MC68HSC05J1A . . . . . . . . . . . . . . . . . . . . 123
MC68HC05J1A -- Rev. 3.0 MOTOROLA List of Sections
Technical Data 5
List of Sections
Technical Data 6 List of Sections
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Technical Data -- MC68HC05J1A
Table of Contents
Section 1. General Description
1.1 1.2 1.3 1.4 1.5 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Mask Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 MCU Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.6 Pin Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.6.1 VDD and VSS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.6.2 OSC1 and OSC2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.6.2.1 Crystal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.6.2.2 Ceramic Resonator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.6.2.3 RC Oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 1.6.2.4 External Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 1.6.3 RESET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 1.6.4 IRQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 1.6.5 PA7-PA0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 1.6.6 PB5-PB0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Section 2. Memory
2.1 2.2 2.3 2.4 2.5 2.6
MC68HC05J1A -- Rev. 3.0 MOTOROLA Table of Contents
Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Memory Map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Input/Output (I/O) Section. . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 Random-Access Memory (RAM) . . . . . . . . . . . . . . . . . . . . . . . 28 Read-Only Memory (ROM). . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Technical Data 7
Table of Contents Section 3. Central Processor Unit (CPU)
3.1 3.2 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.3 CPU Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 3.3.1 Accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.3.2 Index Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.3.3 Stack Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 3.3.4 Program Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.3.5 Condition Code Register . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 3.4 Arithmetic/Logic Unit (ALU) . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Section 4. Interrupts
4.1 4.2 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.3 Interrupt Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 4.3.1 Software Interrupt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 4.3.2 External Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 4.3.2.1 IRQ Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 4.3.2.2 PA3-PA0 Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 4.3.2.3 IRQ Status and Control Register . . . . . . . . . . . . . . . . . . . 45 4.3.3 Timer Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 4.3.3.1 Timer Overflow Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . 46 4.3.3.2 Real-Time Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 4.4 Interrupt Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46
Section 5. Resets
5.1 5.2 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.3 Reset Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 5.3.1 Power-On Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 5.3.2 External Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5.3.3 Computer Operating Properly (COP) Reset . . . . . . . . . . . . . 51 5.3.4 Illegal Address Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Technical Data 8 Table of Contents MC68HC05J1A -- Rev. 3.0 MOTOROLA
Table of Contents
5.4 Reset States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.4.1 CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.4.2 I/O Port Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.4.3 Multifunction Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 5.4.4 COP Watchdog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Section 6. Low-Power Modes
6.1 6.2 6.3 6.4 6.5 6.6 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Stop Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Wait Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Halt Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Data-Retention Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Section 7. Parallel Input/Output (I/O)
7.1 7.2 7.3 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 I/O Port Function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
7.4 Port A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 7.4.1 Port A Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 7.4.2 Data Direction Register A. . . . . . . . . . . . . . . . . . . . . . . . . . . 63 7.4.3 Pulldown Register A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 7.4.4 Port A External Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 7.5 Port B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 7.5.1 Port B Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 7.5.2 Data Direction Register B. . . . . . . . . . . . . . . . . . . . . . . . . . . 68 7.5.3 Pulldown Register B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
MC68HC05J1A -- Rev. 3.0 MOTOROLA Table of Contents
Technical Data 9
Table of Contents Section 8. Multifunction Timer
8.1 8.2 8.3 8.4 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Timer Status and Control Register . . . . . . . . . . . . . . . . . . . . . . 73 COP Watchdog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Section 9. Instruction Set
9.1 9.2 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
9.3 Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 9.3.1 Inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 9.3.2 Immediate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 9.3.3 Direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 9.3.4 Extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 9.3.5 Indexed, No Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 9.3.6 Indexed, 8-Bit Offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 9.3.7 Indexed, 16-Bit Offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 9.3.8 Relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 9.4 Instruction Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 9.4.1 Register/Memory Instructions. . . . . . . . . . . . . . . . . . . . . . . .82 9.4.2 Read-Modify-Write Instructions . . . . . . . . . . . . . . . . . . . . . . 83 9.4.3 Jump/Branch Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . 84 9.4.4 Bit Manipulation Instructions . . . . . . . . . . . . . . . . . . . . . . . .86 9.4.5 Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 9.5 9.6 Instruction Set Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Opcode Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Section 10. Electrical Specifications
10.1 10.2 10.3 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Maximum Ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Technical Data 10 Table of Contents
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Table of Contents
10.4 10.5 10.6 10.7 10.8 10.9
Operating Temperature Range. . . . . . . . . . . . . . . . . . . . . . . . . 97 Thermal Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Power Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 5.0-Volt DC Electrical Characteristics. . . . . . . . . . . . . . . . . . . .99 3.3-Volt DC Electrical Characteristics. . . . . . . . . . . . . . . . . . .100 5.0-Volt Control Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
10.10 3.3-Volt Control Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Section 11. Mechanical Specifications
11.1 11.2 11.3 11.4 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 20-Pin Plastic Dual In-Line Package (PDIP). . . . . . . . . . . . . .110 20-Pin Small Outline Integrated Circuit Package (SOIC) . . . . 110
Section 12. Ordering Information
12.1 12.2 12.3 12.4 12.5 12.6 12.7 12.8 12.9 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 MC Order Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111 MCU Ordering Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Application Program Media. . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Diskettes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 EPROMs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 ROM Program Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 ROM Verification Units (RVUs). . . . . . . . . . . . . . . . . . . . . . . . 115
MC68HC05J1A -- Rev. 3.0 MOTOROLA Table of Contents
Technical Data 11
Table of Contents Appendix A. MC68HCL05J1A
A.1 A.2 A.3 A.4 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 DC Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . 118 MC Ordering Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Appendix B. MC68HSC05J1A
B.1 B.2 B.3 B.4 B.5 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 DC Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . 124 Control Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 MC Ordering Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Technical Data 12 Table of Contents
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Technical Data -- MC68HC05J1A
List of Figures
Figure 1-1 1-2 1-3 1-4 1-5 1-6 1-7 1-8 1-9 2-1 2-2 3-1 3-2 3-3 3-4 3-5 3-6 4-1 4-2 4-3
Title
Page
MC68HC05J1A Block Diagram . . . . . . . . . . . . . . . . . . . . . . 20 Pin Assignments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 Bypassing Layout Recommendation . . . . . . . . . . . . . . . . . . 22 Crystal Connections with Feedback Resistor Mask Option . . . . . . . . . . . . . . . 23 Crystal Connections without Feedback Resistor Mask Option. . . . . . . . . . . . . 23 Ceramic Resonator Connections with Feedback Resistor Mask Option . . . . . . . . . . . . . . . 24 Ceramic Resonator Connections without Feedback Resistor Mask Option. . . . . . . . . . . . . 24 RC Oscillator Connections . . . . . . . . . . . . . . . . . . . . . . . . . . 25 External Clock Connections . . . . . . . . . . . . . . . . . . . . . . . . . 25 Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 I/O Register Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Programming Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Accumulator (A) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Index Register (X) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Stack Pointer (SP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Program Counter (PC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 Condition Code Register (CCR) . . . . . . . . . . . . . . . . . . . . . . 38 External Interrupt Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 IRQ Status and Control Register (ISCR) . . . . . . . . . . . . . . . 45 Stacking Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
MC68HC05J1A -- Rev. 3.0 MOTOROLA List of Figures
Technical Data 13
List of Figures
Figure 4-4 5-1 5-2 6-1 7-1 7-2 7-3 7-4 7-5 7-6 7-7 7-8 8-1 8-2 8-3 8-4 10-1 10-2 10-3 10-4 10-5 10-6 10-7 10-8 10-9 10-10 10-11 A-1 A-2
Technical Data 14 List of Figures
Title
Page
Interrupt Flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Reset Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 COP Register (COPR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51 Stop/Wait/Halt Flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Port A Data Register (PORTA). . . . . . . . . . . . . . . . . . . . . . . 62 Data Direction Register A (DDRA) . . . . . . . . . . . . . . . . . . . .63 Pulldown Register A (PDRA) . . . . . . . . . . . . . . . . . . . . . . . .64 Port A I/O Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65 Port B Data Register (PORTB). . . . . . . . . . . . . . . . . . . . . . . 67 Data Direction Register B (DDRB) . . . . . . . . . . . . . . . . . . . .68 Pulldown Register B (PDRB) . . . . . . . . . . . . . . . . . . . . . . . .69 Port B I/O Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70 Multifunction Timer Block Diagram. . . . . . . . . . . . . . . . . . . .72 Timer Status and Control Register (TSCR) . . . . . . . . . . . . . 73 Timer Counter Register (TCNTR) . . . . . . . . . . . . . . . . . . . . 75 COP Register (COPR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76 Typical VOH/IOH (VDD = 5.0 V) . . . . . . . . . . . . . . . . . . . . . . 101 Typical VOH/IOH (VDD = 3.3 V) . . . . . . . . . . . . . . . . . . . . . . 101 Typical VOL/IOL (VDD = 5.0 V) . . . . . . . . . . . . . . . . . . . . . . 102 Typical VOL/IOL (VDD = 3.3 V) . . . . . . . . . . . . . . . . . . . . . . 102 Typical Operating IDD (25C) . . . . . . . . . . . . . . . . . . . . . . .103 Typical Wait Mode IDD (25C) . . . . . . . . . . . . . . . . . . . . . . 103 Typical Internal Operating Frequency for Various VDD at 25C -- RC Option Only . . . . . . . . .104 External Interrupt Timing . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Stop Mode Recovery Timing . . . . . . . . . . . . . . . . . . . . . . .107 Power-On Reset Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 External Reset Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Maximum Run Mode IDD versus Frequency . . . . . . . . . . . 120 Maximum Wait Mode IDD versus Frequency . . . . . . . . . . . 121
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Technical Data -- MC68HC05J1A
List of Tables
Table 4-1 7-1 7-2 8-1 9-1 9-2 9-3 9-4 9-5 9-6 9-7 12-1 A-1 A-2 A-3 A-4 A-5 B-1 B-2 B-3 B-4
Title
Page
Reset/Interrupt Vector Addresses . . . . . . . . . . . . . . . . . . . . . 47 Port A Pin Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Port B Pin Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Real-Time Interrupt Rate Selection . . . . . . . . . . . . . . . . . . . . 74 Register/Memory Instructions. . . . . . . . . . . . . . . . . . . . . . . . . 82 Read-Modify-Write Instructions . . . . . . . . . . . . . . . . . . . . . . . 83 Jump and Branch Instructions . . . . . . . . . . . . . . . . . . . . . . . .85 Bit Manipulation Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . 86 Control Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Instruction Set Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Opcode Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94 MC Order Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Low-Power Output Voltage (VDD = 1.8-2.4 Vdc) . . . . . . . . .118 Low-Power Output Voltage (VDD = 2.5-3.6 Vdc) . . . . . . . . .118 Low-Power Supply Current. . . . . . . . . . . . . . . . . . . . . . . . . . 119 Low-Power Pulldown Current . . . . . . . . . . . . . . . . . . . . . . . . 120 MC Order Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 High-Speed Supply Current . . . . . . . . . . . . . . . . . . . . . . . . . 124 High-Speed Control Timing (VDD = 5.0 V 10%). . . . . . . . .125 High-Speed Control Timing (VDD = 3.3 V 10%) . . . . . . . . 125 MC Order Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
MC68HC05J1A -- Rev. 3.0 MOTOROLA List of Tables
Technical Data 15
List of Tables
Technical Data 16 List of Tables
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Technical Data -- MC68HC05J1A
Section 1. General Description
1.1 Contents
1.2 1.3 1.4 1.5 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Mask Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 MCU Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.6 Pin Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.6.1 VDD and VSS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.6.2 OSC1 and OSC2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.6.2.1 Crystal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.6.2.2 Ceramic Resonator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.6.2.3 RC Oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 1.6.2.4 External Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 1.6.3 RESET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 1.6.4 IRQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 1.6.5 PA7-PA0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 1.6.6 PB5-PB0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
MC68HC05J1A -- Rev. 3.0 MOTOROLA General Description
Technical Data 17
General Description 1.2 Introduction
The MC68HC05J1A is a member of the low-cost, high-performance M68HC05 Family of 8-bit microcontroller units (MCU). The M68HC05 Family is based on the customer-specified integrated circuit (CSIC) design strategy. All MCUs in the family use the popular M68HC05 central processor unit (CPU) and are available with a variety of subsystems, memory sizes and types, and package types. On-chip memory of the MC68HC05J1A includes: * * 1240 bytes of user read-only memory (ROM) 64 bytes of user random-access memory (RAM)
Information on the MC68HCL05J1A, a low-power version of the MC68HC05J1A, is introduced in Appendix A. MC68HCL05J1A. Information on the MC68HSC05J1A, a high-speed version of the MC68HC05J1A, is introduced in Appendix B. MC68HSC05J1A.
1.3 Features
Features of the MCU include: * * * * * Popular M68HC05 CPU Memory-mapped input/output (I/O) registers 1240 bytes of user ROM including eight user vector locations 64 bytes of user RAM 14 bidirectional I/O pins with these features: - Software programmable pulldown devices - Four I/O pins with 8-mA current sinking capability - Four I/O pins with maskable external interrupt capability * * * Hardware mask and flag for external interrupts Fully static operation with no minimum clock speed On-chip oscillator with connections for a crystal or ceramic resonator or for a resistor-capacitor (RC) network
MC68HC05J1A -- Rev. 3.0 General Description MOTOROLA
Technical Data 18
General Description Mask Options
* * * * * * * *
15-bit multifunction timer Computer operating properly (COP) watchdog Power-saving stop (or halt), wait, and data-retention modes Illegal address reset Internal steering diode between RESET and VDD pins 8 x 8 unsigned multiply instruction 20-pin plastic dual in-line package (PDIP) 20-pin small outline integrated circuit package (SOIC)
1.4 Mask Options
Available MC68HC05J1A mask options are: * * On-chip oscillator connections: crystal/ceramic resonator connections or resistor-capacitor (RC) network connections Crystal/ceramic resonator feedback resistor: connected or not connected (available only with crystal/ceramic oscillator mask option) STOP instruction: enabled or disabled (converted to WAIT instruction) External interrupt pins: edge-triggered or edge- and level-triggered Port A and port B pulldown resistors: connected or not connected COP watchdog timer: enabled or disabled Port A external interrupt capability: enabled or disabled
* * * * *
MC68HC05J1A -- Rev. 3.0 MOTOROLA General Description
Technical Data 19
General Description 1.5 MCU Structure
Figure 1-1 shows the structure of the MC68HC05J1A MCU.
USER ROM -- 1240 BYTES
USER RAM -- 64 BYTES
* * PA5 * PA4 * PA3 ** PA2 ** PA1 ** PA0 **
PA7 PA6
DATA DIRECTION REGISTER A DATA DIRECTION REGISTER B
CPU CONTROL
ARITHMETIC/LOGIC UNIT ACCUMULATOR
* 8-mA sink capability ** External interrupt capability
PB5 PB4 PORT B PB3 PB2 PB1 PB0
IRQ M68HC05 MCU RESET RESET STACK POINTER 0000000011 PROGRAM COUNTER 00000 CONDITION CODE REGISTER 111HI NCZ INDEX REGISTER
COP WATCHDOG AND ILLEGAL ADDRESS DETECT CPU CLOCK
MULTIFUNCTION TIMER
VDD VSS OSC1 OSC2
POWER
INTERNAL OSCILLATOR
DIVIDE BY TWO
INTERNAL CLOCK
Figure 1-1. MC68HC05J1A Block Diagram
Technical Data 20 General Description
MC68HC05J1A -- Rev. 3.0 MOTOROLA
PORT A
General Description Pin Assignments
1.6 Pin Assignments
Figure 1-2 shows the MC68HC05J1A pin assignments.
OSC1 OSC2 PB5 PB4 PB3 PB2 PB1 PB0 VDD VSS
1 2 3 4 5 6 7 8 9 10
20 19 18 17 16 15 14 13 12 11
RESET IRQ PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7
Figure 1-2. Pin Assignments
1.6.1 VDD and VSS VDD and VSS are the power supply and ground pins. The MCU operates from a single 5-V power supply. Very fast signal transitions occur on the MCU pins, placing high short-duration current demands on the power supply. To prevent noise problems, take special care to provide good power supply bypassing at the MCU. Place bypass capacitors as close to the MCU as possible, as Figure 1-3 shows. C2 is an optional bulk current bypass capacitor for use in applications that require the port pins to source high current levels.
MC68HC05J1A -- Rev. 3.0 MOTOROLA General Description
Technical Data 21
General Description
V+ VDD
VDD
MCU C1 0.1 F VSS + C2 C2 C1
VSS
Figure 1-3. Bypassing Layout Recommendation
1.6.2 OSC1 and OSC2 The OSC1 and OSC2 pins are the control connections for the on-chip oscillator. Depending on the mask option selected, the oscillator can be driven by any one of these: * * * * Crystal Ceramic resonator Resistor-capacitor (RC) network External clock signal
The frequency of the internal oscillator is fOSC. The MCU divides the internal oscillator output by two to produce the internal clock with a frequency of fOP. An internal feedback resistor between the OSC1 and OSC2 pins is available as a mask option. The feedback resistor mask option is available only when the crystal/ceramic resonator mask option is also selected. 1.6.2.1 Crystal With the crystal/ceramic resonator mask option, a crystal connected to the OSC1 and OSC2 pins can drive the on-chip oscillator. Figure 1-4 and Figure 1-5 show a typical crystal oscillator circuit for an AT-cut, parallel resonant crystal. Follow the crystal supplier's recommendations, as the crystal parameters determine the external component values
Technical Data 22 General Description
MC68HC05J1A -- Rev. 3.0 MOTOROLA
General Description Pin Assignments
required to provide reliable startup and maximum stability. The load capacitance values used in the oscillator circuit design should include all stray layout capacitances. To minimize output distortion, mount the crystal and capacitors as close as possible to the pins.
NOTE:
Use an AT-cut crystal and not an AT-strip crystal. The MCU may overdrive an AT-strip crystal.
VSS MCU C3 OSC1 OSC1 OSC2 XTAL OSC2 C4 XTAL C3 27 pF C4 27 pF C2 C1 VSS VDD
Figure 1-4. Crystal Connections with Feedback Resistor Mask Option
VSS MCU OSC1 OSC2 C3 OSC1 R 10 M XTAL R OSC2 C4 XTAL C3 27 pF C4 27 pF C2 C1 VSS VDD
Figure 1-5. Crystal Connections without Feedback Resistor Mask Option
MC68HC05J1A -- Rev. 3.0 MOTOROLA General Description
Technical Data 23
General Description
1.6.2.2 Ceramic Resonator To reduce cost, use a ceramic resonator in place of the crystal. Use the circuit in Figure 1-6 or Figure 1-7 for a ceramic resonator and follow the resonator manufacturer's recommendations. The load capacitance values used in the oscillator circuit design should include all stray layout capacitances. To minimize output distortion, mount the resonator as close as possible to the pins.
VSS MCU C3 CERAMIC RESONATOR OSC1
OSC1
OSC2
OSC2
C3 27 pF
CERAMIC RESONATOR
C4 C4 27 pF VDD C2 C1 VSS
Figure 1-6. Ceramic Resonator Connections with Feedback Resistor Mask Option
VSS C3 MCU CERAMIC RESONATOR OSC1 R OSC2
OSC1
R 10 M
OSC2
C4 VDD C4 27 pF C2 C1 VSS
C3 27 pF
CERAMIC RESONATOR
Figure 1-7. Ceramic Resonator Connections without Feedback Resistor Mask Option
Technical Data 24 General Description MC68HC05J1A -- Rev. 3.0 MOTOROLA
General Description Pin Assignments
1.6.2.3 RC Oscillator For maximum cost reduction, the RC oscillator mask option allows the configuration shown in Figure 1-8 to drive the on-chip oscillator. The OSC2 signal is a square wave, and the signal on OSC1 is a triangular wave. The optimum frequency for the RC oscillator configuration is 2 MHz. Mount the RC components as close as possible to the pins for startup stabilization and to minimize output distortion.
OSC1 R MCU OSC1 OSC2 OSC2
R
VDD C2 C1 VSS
Figure 1-8. RC Oscillator Connections 1.6.2.4 External Clock With the RC oscillator mask option, an external clock from another CMOS-compatible device can drive the OSC1 input. Leave the OSC2 pin unconnected, as Figure 1-9 shows.
MCU OSC1 OSC2
EXTERNAL CMOS CLOCK
Figure 1-9. External Clock Connections
MC68HC05J1A -- Rev. 3.0 MOTOROLA General Description
Technical Data 25
General Description
1.6.3 RESET A logic 0 on the RESET pin forces the MCU to a known startup state. See 5.3.2 External Reset for more information.
1.6.4 IRQ The IRQ pin is an asynchronous external interrupt pin. See 4.3.2.1 IRQ Pin.
1.6.5 PA7-PA0 PA7-PA0 are the pins of port A, a general-purpose, bidirectional I/O port. See 7.4 Port A.
1.6.6 PB5-PB0 PB5-PB0 are the pins of port B, a general-purpose, bidirectional I/O port. See 7.5 Port B.
Technical Data 26 General Description
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Technical Data -- MC68HC05J1A
Section 2. Memory
2.1 Contents
2.2 2.3 2.4 2.5 2.6 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Memory Map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Input/Output (I/O) Section. . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 Random-Access Memory (RAM) . . . . . . . . . . . . . . . . . . . . . . . 28 Read-Only Memory (ROM). . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.2 Introduction
This section describes the organization of the on-chip memory.
2.3 Memory Map
The central processor unit (CPU) can address 2 Kbytes of memory space as shown in Figure 2-1. The read-only memory (ROM) portion of memory holds the program instructions, fixed data, user-defined vectors, and interrupt service routines. The random-access memory (RAM) portion of memory holds variable data. Input/output (I/O) registers are memory-mapped so that the CPU can access their locations in the same way that it accesses all other memory locations.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Memory
Technical Data 27
Memory 2.4 Input/Output (I/O) Section
The first 32 addresses of the memory space, $0001-$001F, are the I/O section. These are the addresses of the I/O control registers, status registers, and data registers. See Figure 2-2. One I/O register shown in Figure 2-2 is located outside the 32-byte I/O section: the computer operating properly (COP) register is mapped at $07F0.
2.5 Random-Access Memory (RAM)
The 64 addresses from $00C0 to $00FF serve as both the user RAM and the stack RAM. The CPU uses five stack RAM bytes to save all CPU register contents before processing an interrupt. During a subroutine call, the CPU uses two bytes to store the return address. The stack pointer decrements during pushes and increments during pulls.
NOTE:
Be careful when using nested subroutines or multiple interrupt levels. The CPU may overwrite data in the RAM during a subroutine or during the interrupt stacking operation.
2.6 Read-Only Memory (ROM)
The ROM is located in two areas of the memory map: 1. Addresses $0300-$07CF contain 1232 bytes of user ROM. 2. Addresses $07F8-$07FF contain 16 bytes of ROM reserved for user vectors.
Technical Data 28 Memory
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Memory Read-Only Memory (ROM)
$0000
I/O REGISTERS 32 BYTES
$001F $0020 $00BF $00C0
UNUSED 160 BYTES
USER RAM 64 BYTES
STACK RAM 64 BYTES
PORT A DATA REGISTER PORT B DATA REGISTER UNUSED UNUSED PORT A DATA DIRECTION REGISTER PORT B DATA DIRECTION REGISTER UNUSED UNUSED TIMER STATUS AND CONTROL REGISTER TIMER COUNTER REGISTER IRQ STATUS AND CONTROL REGISTER UNUSED UNUSED UNUSED UNUSED UNUSED PORT A PULLDOWN REGISTER PORT B PULLDOWN REGISTER UNUSED UNUSED UNUSED * * * RESERVED
$00FF $0100 $02FF $0300
UNUSED 512 BYTES
$0000 $0001 $0002 $0003 $0004 $0005 $0006 $0007 $0008 $0009 $000A $000B $000C $000D $000E $000F $0010 $0011 $0012 $0013 $0014 * * * $001F
USER ROM 1232 BYTES
$07CF $07D0 TEST ROM 32 BYTES $07EF $07F0 $07F7 $07F8 $07FF RESERVED FOR TEST (ROM) 8 BYTES USER VECTORS (ROM) 8 BYTES
COP REGISTER * RESERVED RESERVED RESERVED RESERVED RESERVED RESERVED RESERVED TIMER VECTOR (HIGH BYTE) TIMER VECTOR (LOW BYTE) EXTERNAL INTERRUPT VECTOR (HIGH BYTE) EXTERNAL INTERRUPT VECTOR (LOW BYTE) SOFTWARE INTERRUPT VECTOR (HIGH BYTE) SOFTWARE INTERRUPT VECTOR (LOW BYTE) RESET VECTOR (LOW BYTE) RESET VECTOR (LOW BYTE)
$07F0 $07F1 $07F2 $07F3 $07F4 $07F5 $07F6 $07F7 $07F8 $07F9 $07FA $07FB $07FC $07FD $07FE $07FF
COP *Writing to bit 0 of $07F0 clears the ROM watchdog. Reading $07F0 returns data.
Figure 2-1. Memory Map
MC68HC05J1A -- Rev. 3.0 MOTOROLA Memory
Technical Data 29
Memory
Addr.
Register Name Read: Port A Data Register (PORTA) Write: See page 62. Reset: Read: Port B Data Register (PORTB) Write: See page 67. Reset: Unimplemented Unimplemented
Bit 7 PA7
6 PA6
5 PA5
4 PA4
3 PA3
2 PA2
1 PA1
Bit 0 PA0
$0000
Unaffected by reset 0 0 PB5 PB4 PB3 PB2 PB1 PB0
$0001
Unaffected by reset
$0002 $0003
$0004
Read: Data Direction Register A DDRA7 (DDRA) Write: See page 63. Reset: 0 Read: Data Direction Register B (DDRB) Write: See page 68. Reset: Unimplemented Unimplemented Read: Timer Status and Control Register (TSCR) Write: See page 73. Reset: Read: Timer Counter Register (TCNTR) Write: See page 75. Reset: Read: IRQ Status and Control Register (ISCR) Write: See page 45. Reset: TOF 0
DDRA6 0 0
DDRA5 0 DDRB5
DDRA4 0 DDRB4 0
DDRA3 0 DDRB3 0
DDRA2 0 DDRB2 0
DDRA1 0 DDRB1 0
DDRA0 0 DDRB0 0
$0005
0
0
0
$0006 $0007
RTIF TOIE RTIE
0 TOFR
0 RT1 RTIFR 0 Bit 2 1 Bit 1 1 Bit 0 RT0
$0008
0 Bit 7
0 Bit 6
0 Bit 5
0 Bit 4
0 Bit 3
$0009
0 IRQE 1
0 IRQF
0 0
0 0 0 R
0 0 0 = Reserved
0 0
0
0 0
$000A
IRQR 0 0 0 0 0
= Unimplemented
U = Unaffected
Figure 2-2. I/O Register Summary (Sheet 1 of 2)
Technical Data 30 Memory MC68HC05J1A -- Rev. 3.0 MOTOROLA
Memory Read-Only Memory (ROM)
Addr. $000B $000F
Register Name Unimplemented
Bit 7
6
5
4
3
2
1
Bit 0
Unimplemented Read: Pulldown Register A (PDRA) Write: PDIA7 See page 64. Reset: 0 Read: Pulldown Register B (PDRB) Write: See page 69. Reset: Unimplemented
$0010
PDIA6 0
PDIA5 0
PDIA4 0
PDIA3 0
PDIA2 0
PDIA1 0
PDIA0 0
$0011
PDIB5 U U 0
PDIB4 0
PDIB3 0
PDIB2 0
PDIB1 0
PDIB0 0
$0012 $001E
Unimplemented Read:
$001F
Reserved
R Write: Reset:
R
R
R
R
R
R
R
Unaffected by reset
$07F0
COP Register Read: (COPR) Write: See page 51. Reset:
COPC U U U U R U = Reserved U U 0
= Unimplemented
U = Unaffected
Figure 2-2. I/O Register Summary (Sheet 2 of 2)
MC68HC05J1A -- Rev. 3.0 MOTOROLA Memory
Technical Data 31
Memory
Technical Data 32 Memory
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Technical Data -- MC68HC05J1A
Section 3. Central Processor Unit (CPU)
3.1 Contents
3.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.3 CPU Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 3.3.1 Accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.3.2 Index Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.3.3 Stack Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 3.3.4 Program Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.3.5 Condition Code Register . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 3.4 Arithmetic/Logic Unit (ALU) . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.2 Introduction
This section describes the central processor unit (CPU) registers.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Central Processor Unit (CPU)
Technical Data 33
Central Processor Unit (CPU) 3.3 CPU Registers
Figure 3-1 shows the five CPU registers. CPU registers are not part of the memory map.
7
6
5
4
3
2
1
0 ACCUMULATOR (A)
7
6
5
4
3
2
1
0 INDEX REGISTER (X)
15 0 15 0
14 0 14 0
13 0 13 0
12 0 12 0
11 0 11 0
10 0 10
9 0 9 PCL
8 0 8
7 1 7
6 1 6
5
4
3 SP
2
1
0 STACK POINTER (SP)
5
4 PCH
3
2
1
0 PROGRAM COUNTER (PC)
7 1
6 1
5 1
4 H
3 I
2 N
1 Z
0 C CONDITION CODE REGISTER (CCR)
HALF-CARRY FLAG INTERRUPT MASK NEGATIVE FLAG ZERO FLAG CARRY/BORROW FLAG
Figure 3-1. Programming Model
Technical Data 34 Central Processor Unit (CPU)
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Central Processor Unit (CPU) CPU Registers
3.3.1 Accumulator The accumulator (A) shown in Figure 3-2 is a general-purpose 8-bit register. The CPU uses the accumulator to hold operands and results of arithmetic and non-arithmetic operations.
Bit 7 Read: Write: Reset:
6
5
4
3
2
1
Bit 0
Unaffected by reset
Figure 3-2. Accumulator (A)
3.3.2 Index Register In the indexed addressing modes, the CPU uses the byte in the index register (X) shown in Figure 3-3 to determine the conditional address of the operand. See 9.3.5 Indexed, No Offset, 9.3.6 Indexed, 8-Bit Offset, and 9.3.7 Indexed, 16-Bit Offset for more information on indexed addressing. The 8-bit index register also can serve as a temporary data storage location.
Bit 7 Read: Write: Reset:
6
5
4
3
2
1
Bit 0
Unaffected by reset
Figure 3-3. Index Register (X)
MC68HC05J1A -- Rev. 3.0 MOTOROLA Central Processor Unit (CPU)
Technical Data 35
Central Processor Unit (CPU)
3.3.3 Stack Pointer The stack pointer (SP) shown in Figure 3-4 is a 16-bit register that contains the address of the next free location on the stack. During a reset or after the reset stack pointer (RSP) instruction, the stack pointer initializes to $00FF. The address in the stack pointer decrements as data is pushed onto the stack and increments as data is pulled from the stack. The 10 most significant bits of the stack pointer are fixed permanently at 0000000011, so the stack pointer produces addresses from $00C0 to $00FF. If subroutines and interrupts use more than 64 stack locations, the stack pointer wraps around to address $00FF and begins writing over the previously stored data. A subroutine uses two stack locations. An interrupt uses five locations.
Bit 15 Read: Write: Reset: 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 Bit 0 0
14 0
13 0
12 0
11 0
10 0
9 0
8 0
7 1
6 1
5 0
4 0
3 0
2 0
1 0
= Unimplemented
Figure 3-4. Stack Pointer (SP)
Technical Data 36 Central Processor Unit (CPU)
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Central Processor Unit (CPU) CPU Registers
3.3.4 Program Counter The program counter (PC) shown in Figure 3-5 is a 16-bit register that contains the address of the next instruction or operand to be fetched. The five most significant bits of the program counter are ignored internally and appear as 00000. Normally, the address in the program counter automatically increments to the next sequential memory location every time an instruction or operand is fetched. Jump, branch, and interrupt operations load the program counter with an address other than that of the next sequential location.
Bit 15 Read: Write: Reset: 0 0 0 0 0 Loaded with vector from $07FE and $07FF 0 Bit 0
14 0
13 0
12 0
11 0
10
9
8
7
6
5
4
3
2
1
Figure 3-5. Program Counter (PC)
MC68HC05J1A -- Rev. 3.0 MOTOROLA Central Processor Unit (CPU)
Technical Data 37
Central Processor Unit (CPU)
3.3.5 Condition Code Register The condition code register (CCR) shown in Figure 3-6 is an 8-bit register whose three most significant bits are permanently fixed at 111. The condition code register contains the interrupt mask and four flags that indicate the results of prior instructions.
Bit 7 Read: Write: Reset: 1 1
6 1
5 1
4 H
3 I 1 U = Unaffected
2 N U
1 Z U
Bit 0 C U
1
1
U
= Unimplemented
Figure 3-6. Condition Code Register (CCR) H -- Half-Carry Flag The CPU sets the half-carry flag when a carry occurs between bits 3 and 4 of the accumulator during an add without carry (ADD) or add with carry (ADC) operation. The half-carry bit is required for binary-coded decimal (BCD) arithmetic operations. Reset has no effect on the half-carry flag. I -- Interrupt Mask Flag Setting the interrupt mask (I) disables interrupts. If an interrupt request occurs while the interrupt mask is a logic 0, the CPU saves the CPU registers on the stack, sets the interrupt mask, and then fetches the interrupt vector. If an interrupt request occurs while the interrupt mask is set, the interrupt request is latched. The CPU processes the latched interrupt as soon as the interrupt mask is cleared again. A return-from-interrupt (RTI) instruction pulls the CPU registers from the stack, restoring the interrupt mask to its cleared state. After a reset, the interrupt mask is set and can be cleared only by a clear interrupt mask bit (CLI), STOP, or WAIT instruction.
Technical Data 38 Central Processor Unit (CPU)
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Central Processor Unit (CPU) Arithmetic/Logic Unit (ALU)
N -- Negative Flag The CPU sets the negative flag when an arithmetic operation, logical operation, or data manipulation produces a negative result (bit 7 in the results is a logic 1). Reset has no effect on the negative flag. Z -- Zero Flag The CPU sets the zero flag when an arithmetic operation, logical operation, or data manipulation produces a result of $00. Reset has no effect on the zero flag. C -- Carry/Borrow Flag The CPU sets the carry/borrow flag when an addition operation produces a carry out of bit 7 of the accumulator or when a subtraction operation requires a borrow. Some logical operations and data manipulation instructions also clear or set the carry/borrow bit. Reset has no effect on the carry/borrow flag.
3.4 Arithmetic/Logic Unit (ALU)
The arithmetic/logic unit (ALU) performs the arithmetic and logical operations defined by the instruction set. The binary arithmetic circuits decode instructions and set up the ALU for the selected operation. Most binary arithmetic is based on the addition algorithm, carrying out subtraction as negative addition. Multiplication is not performed as a discrete operation but as a chain of addition and shift operations within the ALU. The multiply instruction requires 11 internal clock cycles to complete this chain of operations.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Central Processor Unit (CPU)
Technical Data 39
Central Processor Unit (CPU)
Technical Data 40 Central Processor Unit (CPU)
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Technical Data -- MC68HC05J1A
Section 4. Interrupts
4.1 Contents
4.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.3 Interrupt Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 4.3.1 Software Interrupt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 4.3.2 External Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 4.3.2.1 IRQ Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 4.3.2.2 PA3-PA0 Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 4.3.2.3 IRQ Status and Control Register . . . . . . . . . . . . . . . . . . . 45 4.3.3 Timer Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 4.3.3.1 Timer Overflow Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . 46 4.3.3.2 Real-Time Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 4.4 Interrupt Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46
4.2 Introduction
This section describes how interrupts temporarily change the normal processing sequence.
4.3 Interrupt Sources
These sources can generate interrupt requests: * * * * SWI (software interrupt) instruction IRQ pin PA3-PA0 pins (mask option) Multifunction timer
MC68HC05J1A -- Rev. 3.0 MOTOROLA Interrupts
Technical Data 41
Interrupts
An interrupt temporarily stops normal program execution to process a particular event. An interrupt does not stop the execution of the instruction in progress, but takes effect when the current instruction completes its execution. Interrupt processing automatically saves the central processor unit (CPU) registers on the stack and loads the program counter with a user-defined vector address.
4.3.1 Software Interrupt The software interrupt (SWI) instruction causes a non-maskable interrupt.
4.3.2 External Interrupts These sources can generate external interrupts: * * IRQ pin PA3-PA0 pins (mask option)
Setting the I bit in the condition code register or clearing the IRQE bit in the interrupt status and control register disables external interrupts. 4.3.2.1 IRQ Pin An interrupt signal on the IRQ pin latches an external interrupt request. When the CPU completes its current instruction, it tests the IRQ latch. If the IRQ latch is set, the CPU then tests the I bit in the condition code register and the IRQE bit in the interrupt status and control register. If the I bit is clear and the IRQE bit is set, the CPU then begins the interrupt sequence. The CPU clears the IRQ latch while it fetches the interrupt vector, so that another external interrupt request can be latched during the interrupt service routine. As soon as the I bit is cleared during the return from interrupt, the CPU can recognize the new interrupt request. Figure 4-1 shows the external interrupt logic.
Technical Data 42 Interrupts
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Interrupts Interrupt Sources
IRQ
TO BIH & BIL INSTRUCTION PROCESSING LEVEL-SENSITIVE TRIGGER
PA3
(MASK OPTION) VDD
PA2
IRQ LATCH R EXTERNAL INTERRUPT REQUEST
PA1
PA0
RST IRQ VECTOR FETCH IRQR IRQE IRQF
PORT A EXTERNAL INTERRUPTS ENABLED (MASK OPTION) INTERNAL DATA BUS
IRQ STATUS AND CONTROL REGISTER
Figure 4-1. External Interrupt Logic External interrupt triggering sensitivity is a mask option. The IRQ pin can be negative edge-triggered only or negative edge- and low level-triggered. With the mask option for an edge- and level-sensitive external interrupt trigger, a falling edge or a low level on the IRQ pin latches an external interrupt request. Edge- and level-sensitive triggering allows the use of multiple wired-OR external interrupt sources. An external interrupt request is latched as long as any source is holding the IRQ pin low. With the mask option for an edge-sensitive only external interrupt trigger, a falling edge on the IRQ pin latches an external interrupt request. A subsequent external interrupt request can be latched only after the voltage level on the IRQ pin returns to logic 1 and then falls again to logic 0.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Interrupts
Technical Data 43
Interrupts
4.3.2.2 PA3-PA0 Pins The mask option for port A external interrupts enables pins PA3-PA0 to serve as additional external interrupt sources. An interrupt signal on a PA3-PA0 pin latches an external interrupt request. After completing the current instruction, the CPU tests the IRQ latch. If the IRQ latch is set, the CPU then tests the I bit in the condition code register and the IRQE bit in the interrupt status and control register. If the I bit is clear and the IRQE bit is set, the CPU then begins the interrupt sequence. The CPU clears the IRQ latch while it fetches the interrupt vector, so that another external interrupt request can be latched during the interrupt service routine. As soon as the I bit is cleared during the return from interrupt, the CPU can recognize the new interrupt request. External interrupt triggering sensitivity is a mask option. The PA3-PA0 pins can be positive edge-triggered only or positive edge- and high level-triggered. With the mask option for an edge- and level-sensitive external interrupt trigger, a rising edge or a high level on a PA3-PA0 pin latches an external interrupt request. Edge- and level-sensitive triggering allows the use of multiple wired-OR external interrupt sources. As long as any source is holding a PA3-PA0 pin high, an external interrupt request is latched, and the CPU continues to execute the interrupt service routine. With the mask option for an edge-sensitive only external interrupt trigger, a rising edge on a PA3-PA0 pin latches an external interrupt request. A subsequent external interrupt request can be latched only after the voltage level of the previous interrupt signal returns to logic 0 and then rises again to logic 1.
Technical Data 44 Interrupts
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Interrupts Interrupt Sources
4.3.2.3 IRQ Status and Control Register The IRQ status and control register (ISCR), shown in Figure 4-2, contains an external interrupt mask, an external interrupt flag, and a flag reset bit.
Address: $000A Bit 7 Read: IRQE Write: Reset: 1 0 0 0 0 0 6 IRQF 0 0 0 0 IRQR 0 0 0 5 4 3 2 1 Bit 0
= Unimplemented
Figure 4-2. IRQ Status and Control Register (ISCR) IRQE -- External Interrupt Request Enable Bit This read/write bit enables external interrupts. Resets set the IRQE bit. 1 = External interrupt processing enabled 0 = External interrupt processing disabled IRQF -- External Interrupt Request Flag The IRQ flag is a clearable, read-only bit that is set when an external interrupt request is pending. Resets clear the IRQF bit. 1 = Interrupt request pending 0 = No interrupt request pending These conditions set the IRQ flag: a. An external interrupt signal on the IRQ pin b. An external interrupt signal on pin PA3, PA2, PA1, or PA0 when PA3-PA0 are enabled to serve as external interrupt sources The CPU clears the IRQ flag when fetching the interrupt vector. Writing to the IRQ flag has no effect. Clear the IRQ flag by writing a logic 1 to the IRQR bit. IRQR -- Interrupt Request Reset Bit This write-only bit clears the IRQ flag. 1 = IRQF bit cleared 0 = No effect
MC68HC05J1A -- Rev. 3.0 MOTOROLA Interrupts Technical Data 45
Interrupts
4.3.3 Timer Interrupts The multifunction timer can generate these interrupts: * * Timer overflow interrupt Real-time interrupt
Setting the I bit in the condition code register disables timer interrupts. 4.3.3.1 Timer Overflow Interrupt A timer overflow interrupt request occurs if the timer overflow flag, TOF, becomes set while the timer overflow interrupt enable bit, TOIE, is also set. See 8.3 Timer Status and Control Register. 4.3.3.2 Real-Time Interrupt A real-time interrupt request occurs if the real-time interrupt flag, RTIF, becomes set while the real-time interrupt enable bit, RTIE, is also set. See 8.3 Timer Status and Control Register.
4.4 Interrupt Processing
The CPU takes these actions to begin servicing an interrupt: * * * Stores the CPU registers on the stack in the order shown in Figure 4-3 Sets the I bit in the condition code register to prevent further interrupts Loads the program counter with the contents of the appropriate interrupt vector locations: - $07FC and $07FD (software interrupt vector) - $07FA and $07FB (external interrupt vector) - $07F8 and $07F9 (timer interrupt vector) The return-from-interrupt (RTI) instruction causes the CPU to recover the CPU registers from the stack as shown in Figure 4-3.
Technical Data 46 Interrupts
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Interrupts Interrupt Processing
$00C0 (BOTTOM OF STACK) $00C1 $00C2 UNSTACKING ORDER * * * * * *
5 4 3 2 1
1 2 3 4 5
CONDITION CODE REGISTER ACCUMULATOR INDEX REGISTER PROGRAM COUNTER (HIGH BYTE) PROGRAM COUNTER (LOW BYTE)
* STACKING ORDER * *
* * * $00FD $00FE $00FF (TOP OF STACK)
Figure 4-3. Stacking Order Table 4-1 summarizes the reset and interrupt sources and vector assignments. Table 4-1. Reset/Interrupt Vector Addresses
Function Source
Power-on RESET pin COP watchdog(1) illegal address User code IRQ pin PA3 pin(2) PA2 pin(2) PA1 pin(2) PA0 pin(2) TOF bit RTIF bit
Local Mask
None
Global Mask
None None None None None
Priority (1 = Highest)
1 1 1 1 Same priority as instruction
Vector Address
Reset
$07FE-$07FF
Software interrupt (SWI)
None
$07FC-$07FD
External interrupt
IRQE bit
I bit
2
$07FA-$07FB
Timer interrupts
TOFE bit RTIE bit
I bit
3
$07F8-$07F9
1. The COP watchdog is a mask option. 2. Port A external interrupt capability is a mask option.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Interrupts
Technical Data 47
Interrupts
Figure 4-4 shows the sequence of events caused by an interrupt.
FROM RESET
YES
I BIT SET?
NO
EXTERNAL INTERRUPT? NO
YES
CLEAR IRQ LATCH
TIMER INTERRUPT? NO
YES
STACK PCL, PCH, X, A, CCR SET I BIT LOAD PC WITH INTERRUPT VECTOR
FETCH NEXT INSTRUCTION
SWI INSTRUCTION? NO
YES
RTI INSTRUCTION? NO
YES
UNSTACK CCR, A, X, PCH, PCL
EXECUTE INSTRUCTION
Figure 4-4. Interrupt Flowchart
Technical Data 48 Interrupts
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Technical Data -- MC68HC05J1A
Section 5. Resets
5.1 Contents
5.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.3 Reset Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 5.3.1 Power-On Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 5.3.2 External Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5.3.3 Computer Operating Properly (COP) Reset . . . . . . . . . . . . . 51 5.3.4 Illegal Address Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.4 Reset States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.4.1 CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.4.2 I/O Port Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.4.3 Multifunction Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 5.4.4 COP Watchdog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.2 Introduction
This section describes the four reset sources and how they initialize the microcontroller unit (MCU).
MC68HC05J1A -- Rev. 3.0 MOTOROLA Resets
Technical Data 49
Resets 5.3 Reset Types
A reset immediately stops the operation of the instruction being executed, initializes certain control bits, and loads the program counter with a user-defined reset vector address. These conditions produce a reset: * * * * Initial power-up (power-on reset) A logic 0 applied to the RESET pin (external reset) Timeout of the mask-optional computer operating properly (COP) watchdog (COP reset) An opcode fetch from an address not in the memory map (illegal address reset)
Figure 5-1 is a block diagram of the reset sources.
COP WATCHDOG (MASK OPTION) VDD
POWER-ON RESET
ILLEGAL ADDRESS RESET
INTERNAL ADDRESS BUS
R RESET RESET LATCH INTERNAL CLOCK
RST
TO CPU AND SUBSYSTEMS
Figure 5-1. Reset Sources
5.3.1 Power-On Reset A positive transition on the VDD pin generates a power-on reset. The power-on reset is strictly for power-up conditions and cannot be used to detect drops in power supply voltage.
Technical Data 50 Resets
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Resets Reset Types
A 4064 tCYC (internal clock cycle) delay after the oscillator becomes active allows the clock generator to stabilize. If the RESET pin is at logic 0 at the end of 4064 tCYC, the MCU remains in the reset condition until the signal on the RESET pin goes to logic 1.
5.3.2 External Reset A logic 0 applied to the RESET pin for one and one-half tCYC generates an external reset. A Schmitt trigger senses the logic level at the RESET pin.
5.3.3 Computer Operating Properly (COP) Reset A timeout of the COP watchdog generates a COP reset. The COP watchdog is part of a software error detection system and must be cleared periodically to start a new timeout period. See 8.4 COP Watchdog. To clear the COP watchdog and prevent a COP reset, write a logic 0 to bit 0 (COPC) of the COP register at location $07F0. The COP register, shown in Figure 5-2, is a write-only register that returns the contents of a ROM location when read. The COP watchdog function is a mask option.
Address: $07F0 Bit 7 Read: Write: Reset: U U U U U U U COPC 0 6 5 4 3 2 1 Bit 0
= Unimplemented
U = Unaffected by reset
Figure 5-2. COP Register (COPR) COPC -- COP Clear Bit COPC is a write-only bit. Periodically writing a logic 0 to COPC prevents the COP watchdog from resetting the MCU.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Resets
Technical Data 51
Resets
5.3.4 Illegal Address Reset An opcode fetch from an address that is not in the ROM (locations $0300-$07FF) or the RAM (locations $00C0-$00FF) generates an illegal address reset.
5.4 Reset States
This subsection describes how resets initialize the MCU.
5.4.1 CPU A reset has the following effects on the CPU: * * * * * * Loads the stack pointer with $FF Sets the I bit in the condition code register, inhibiting interrupts Sets the IRQE bit in the interrupt status and control register Loads the program counter with the user-defined reset vector from locations $07FE and $07FF Clears the stop latch, enabling the CPU clock Clears the wait latch, waking the CPU from the wait mode
5.4.2 I/O Port Registers A reset has these effects on I/O port registers: * * * * *
Technical Data 52 Resets
Clears bits DDRA7-DDRA0 in data direction register A so that port A pins are inputs Clears bits PDIA7-PDIA0 in pulldown register A so that port A pulldown devices are enabled Clears bits DDRB5-DDRB0 in data direction register B so that port B pins are inputs Clears bits PDIB5-PDIB0 in pulldown register B so that port B pulldown devices are enabled Has no effect on port A or port B data registers
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Resets Reset States
5.4.3 Multifunction Timer A reset has these effects on the multifunction timer: * * Clears the timer status and control register Clears the timer counter register
5.4.4 COP Watchdog A reset clears the COP watchdog, if the COP watchdog is enabled by mask option.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Resets
Technical Data 53
Resets
Technical Data 54 Resets
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Technical Data -- MC68HC05J1A
Section 6. Low-Power Modes
6.1 Contents
6.2 6.3 6.4 6.5 6.6 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Stop Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Wait Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Halt Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Data-Retention Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.2 Introduction
This section describes the four low-power modes: * * * * Stop mode Wait mode Halt mode (mask option) Data-retention mode
6.3 Stop Mode
The STOP instruction puts the microcontroller unit (MCU) in its lowest power-consumption mode and has these effects on the MCU: * * * Clears TOF and RTIF, the timer interrupt flags in the timer status and control register, removing any pending timer interrupts Clears TOIE and RTIE, the timer interrupt enable bits in the timer status and control register, disabling further timer interrupts Clears the multifunction timer counter
MC68HC05J1A -- Rev. 3.0 MOTOROLA Low-Power Modes
Technical Data 55
Low-Power Modes
* * * Sets the IRQE bit in the IRQ status and control register to enable external interrupts Clears the I bit in the condition code register, enabling interrupts Stops the internal oscillator, turning off the central processor unit (CPU) clock and the timer clock, including the computer operating properly (COP) watchdog
The STOP instruction does not affect any other registers or any input/output (I/O) lines. These conditions bring the MCU out of stop mode: * An external interrupt signal on the IRQ pin -- A high-to-low transition on the IRQ pin loads the program counter with the contents of locations $07FA and $07FB. An external interrupt signal on a port A external interrupt pin -- If the mask option for the port A external interrupt function is selected, a low-to-high transition on a PA3-PA0 pin loads the program counter with the contents of locations $07FA and $07FB. External reset -- A logic 0 on the RESET pin resets the MCU and loads the program counter with the contents of locations $07FE and $07FF.
*
*
When the MCU exits stop mode, processing resumes after a stabilization delay of 4064 oscillator cycles.
6.4 Wait Mode
The WAIT instruction puts the MCU in an intermediate power-consumption mode and has these effects on the MCU: * * * Clears the I bit in the condition code register, enabling interrupts Sets the IRQE bit in the IRQ status and control register, enabling external interrupts Stops the central processor unit (CPU) clock, but allows the internal oscillator and timer clock to continue to run
The WAIT instruction does not affect any other registers or any I/O lines.
Technical Data 56 Low-Power Modes MC68HC05J1A -- Rev. 3.0 MOTOROLA
Low-Power Modes Halt Mode
These conditions restart the CPU clock and bring the MCU out of wait mode: * An external interrupt signal on the IRQ pin -- A high-to-low transition on the IRQ pin loads the program counter with the contents of locations $07FA and $07FB. An external interrupt signal on a port A external interrupt pin -- If the mask option for the port A external interrupt function is selected, a low-to-high transition on a PA3-PA0 pin loads the program counter with the contents of locations $07FA and $07FB. A timer interrupt -- A timer overflow or a real-time interrupt request loads the program counter with the contents of locations $07F8 and $07F9. A COP watchdog reset -- A timeout of the mask-optional COP watchdog resets the MCU and loads the program counter with the contents of locations $07FE and $07FF. Software can enable real-time interrupts so that the MCU can periodically exit wait mode to reset the COP watchdog. External reset -- A logic 0 on the RESET pin resets the MCU and loads the program counter with the contents of locations $07FE and $07FF.
*
*
*
*
6.5 Halt Mode
If the mask option to disable the STOP instruction is selected, a STOP instruction puts the MCU in halt mode. The halt mode is identical to the wait mode, except that a recovery delay of 1-4064 internal clock cycles occurs when the MCU exits the halt mode. If the mask option to disable the STOP instruction is selected, the COP watchdog cannot be inadvertently turned off by a STOP instruction. Figure 6-1 shows the sequence of events in stop, wait, and halt modes.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Low-Power Modes
Technical Data 57
Low-Power Modes
STOP
STOP DISABLED? NO
YES
HALT
WAIT
CLEAR I BIT IN CCR SET IRQE BIT IN ISCR CLEAR TOF, RTIF, TOIE, AND RTIE BITS IN TSCR TURN OFF INTERNAL OSCILLATOR
CLEAR I BIT IN CCR SET IRQE BIT IN ISCR TURN OFF CPU CLOCK TIMER CLOCK ACTIVE
CLEAR I BIT IN CCR SET IRQE BIT IN ISCR TURN OFF CPU CLOCK TIMER CLOCK ACTIVE
EXTERNAL RESET? NO
YES
YES
EXTERNAL RESET? NO
YES
EXTERNAL RESET? NO
EXTERNAL INTERRUPT? NO
YES
YES
EXTERNAL INTERRUPT? NO
YES
EXTERNAL INTERRUPT? NO
TURN ON INTERNAL OSCILLATOR START STABILIZATION DELAY YES TIMER INTERRUPT? NO YES TIMER INTERRUPT? NO
END OF STABILIZATION DELAY? NO
YES
YES
COP RESET? NO
YES
COP RESET? NO
TURN ON CPU CLOCK
1. LOAD PC WITH RESET VECTOR OR 2. SERVICE INTERRUPT a. SAVE CPU REGISTERS ON STACK b. SET I BIT IN CCR c. LOAD PC WITH INTERRUPT VECTOR
Figure 6-1. Stop/Wait/Halt Flowchart
Technical Data 58 Low-Power Modes MC68HC05J1A -- Rev. 3.0 MOTOROLA
Low-Power Modes Data-Retention Mode
6.6 Data-Retention Mode
In data-retention mode, the MCU retains random-access memory (RAM) contents and CPU register contents at VDD voltages as low as 2.0 Vdc. The data-retention feature allows the MCU to remain in a low power-consumption state during which it retains data, but the CPU cannot execute instructions. To put the MCU in data-retention mode: 1. Drive the RESET pin to logic 0. 2. Lower the VDD voltage. The RESET pin must remain low continuously during data-retention mode. To take the MCU out of data-retention mode: 1. Return VDD to normal operating voltage. 2. Return the RESET pin to logic 1.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Low-Power Modes
Technical Data 59
Low-Power Modes
Technical Data 60 Low-Power Modes
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Technical Data -- MC68HC05J1A
Section 7. Parallel Input/Output (I/O)
7.1 Contents
7.2 7.3 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 I/O Port Function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
7.4 Port A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 7.4.1 Port A Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 7.4.2 Data Direction Register A. . . . . . . . . . . . . . . . . . . . . . . . . . . 63 7.4.3 Pulldown Register A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 7.4.4 Port A External Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 7.5 Port B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 7.5.1 Port B Data Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 7.5.2 Data Direction Register B. . . . . . . . . . . . . . . . . . . . . . . . . . . 68 7.5.3 Pulldown Register B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
7.2 Introduction
This section describes the two bidirectional input/output (I/O) ports.
7.3 I/O Port Function
The 14 bidirectional I/O pins form two parallel I/O ports. Each I/O pin is programmable as an input or an output. The contents of the data direction registers determine the data direction of each I/O pin. All 14 I/O pins have mask-optional, software-programmable pulldown devices.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Parallel Input/Output (I/O)
Technical Data 61
Parallel Input/Output (I/O) 7.4 Port A
Port A is an 8-bit, general-purpose, bidirectional I/O port with these features: * * * Programmable pulldown devices (mask option) 8-mA current sinking capability (pins PA7-PA4) External interrupt capability (mask option: pins PA3-PA0)
7.4.1 Port A Data Register The port A data register (PORTA) contains a bit for each of the port A pins. When a port A pin is programmed to be an output, the state of its data register bit determines the state of the output pin. When a port A pin is programmed to be an input, reading the port A data register returns the logic state of the pin.
Address: $0000 Bit 7 Read: PA7 Write: Reset: Unaffected by reset PA6 PA5 PA4 PA3 PA2 PA1 PA0 6 5 4 3 2 1 Bit 0
Figure 7-1. Port A Data Register (PORTA) PA7-PA0 -- Port A Data Bits These read/write bits are software-programmable. Data direction of each bit is under the control of the corresponding bit in data direction register A. Resets have no effect on port A data.
Technical Data 62 Parallel Input/Output (I/O)
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Parallel Input/Output (I/O) Port A
7.4.2 Data Direction Register A The contents of data direction register A (DDRA) determine whether each port A pin is an input or an output. Writing a logic 1 to a DDRA bit enables the output buffer for the associated port A pin; a logic 0 disables the output buffer. A reset initializes all DDRA bits to 0, configuring all port A pins as inputs.
Address: $0004 Bit 7 Read: DDRA7 Write: Reset: 0 0 0 0 0 0 0 0 DDRA6 DDRA5 DDRA4 DDRA3 DDRA2 DDRA1 DDRA0 6 5 4 3 2 1 Bit 0
Figure 7-2. Data Direction Register A (DDRA) DDRA7-DDRA0 -- Port A Data Direction Bits These read/write bits control port A data direction. 1 = Corresponding port A pin configured as output 0 = Corresponding port A pin configured as input
NOTE:
Avoid glitches on port A pins by writing to the port A data register before changing DDRA bits from logic 0 to logic 1.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Parallel Input/Output (I/O)
Technical Data 63
Parallel Input/Output (I/O)
7.4.3 Pulldown Register A All port A pins have mask-optional, programmable pulldown devices that typically sink 100 A. Clearing the PDIA7-PDIA0 bits in pulldown register A (PDRA) turns on the pulldown devices. See Figure 7-3. Pulldown register A can turn on a port A pulldown device only when the port A pin is an input. Reset clears the PDIA7-PDIA0 bits, turning on all the port A pulldown devices.
Address: $0010 Bit 7 Read: Write: Reset: PDIA7 0 PDIA6 0 PDIA5 0 PDIA4 0 PDIA3 0 PDIA2 0 PDIA1 0 PDIA0 0 6 5 4 3 2 1 Bit 0
= Unimplemented
Figure 7-3. Pulldown Register A (PDRA) PDIA7-PDIA0 -- Port A Pulldown Inhibit Bits Writing logic 0s to these write-only bits turns on the port A pulldown devices. Reading pulldown register A returns undefined data. 1 = Corresponding port A pin pulldown device turned off 0 = Corresponding port A pin pulldown device turned on
NOTE:
Avoid a floating port A input by clearing its pulldown register bit before changing its DDRA bit from logic 1 to logic 0. Do not use read-modify-write instructions on pulldown register A.
Technical Data 64 Parallel Input/Output (I/O)
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Parallel Input/Output (I/O) Port A
7.4.4 Port A External Interrupts If the port A external interrupt mask option is selected, the PA3-PA0 pins serve as external interrupt pins in addition to the IRQ pin. External interrupt triggering sensitivity is a mask option. The PA3-PA0 pins can be positive edge-triggered or positive edge- and high level-triggered.
NOTE:
When testing for external interrupts, the BIH and BIL instructions test the voltage on the IRQ pin, not the state of the internal IRQ signal. Therefore, BIH and BIL cannot test the port A external interrupt pins. Figure 7-4 shows the port A I/O logic.
READ $0004 WRITE $0004 EXTERNAL INTERRUPT REQUEST (PINS PA3-PA0)
DATA DIRECTION REGISTER A BIT DDRAx
INTERNAL DATA BUS
WRITE $0000
PORT A DATA REGISTER BIT PAx
PAx 8-mA SINK CAPABILITY (PINS PA7-PA4)
READ $0000
WRITE $0010
PULLDOWN REGISTER A BIT PDIAx 100-A PULLDOWN DEVICE PULLDOWN DEVICES ENABLED (MASK OPTION)
RESET
Figure 7-4. Port A I/O Circuit
MC68HC05J1A -- Rev. 3.0 MOTOROLA Parallel Input/Output (I/O)
Technical Data 65
Parallel Input/Output (I/O)
When a port A pin is programmed as an output, reading the port bit actually reads the value of the data latch and not the voltage on the pin itself. When a port A pin is programmed as an input, reading the port bit reads the voltage level on the pin. The data latch can always be written, regardless of the state of its DDR bit. Table 7-1 summarizes the operations of the port A pins. Table 7-1. Port A Pin Functions
Pulldown Mask Option No No Yes Yes Yes Yes Control Bits PDIAx X(1) X 0 0 1 1 DDRAx 0 1 0 1 0 1 Input, hi-z Output Input, pulldown on Output, pulldown on Input, hi-z Output I/O Pin Mode Read U (2) U U U U U Accesses to PDRA Write Accesses to DDRA Read/Write Accesses to PORTA Read Pin PA7-PA0 Pin Write PA7-PA0 PA7-PA0 PA7-PA0 PA7-PA0 PA7-PA0 PA7-PA0
PDIA7-PDIA0 DDRA7-DDRA0 PDIA7-PDIA0 DDRA7-DDRA0 PDIA7-PDIA0 DDRA7-DDRA0
PDIA7-PDIA0 DDRA7-DDRA0 PA7-PA00 PDIA7-PDIA0 DDRA7-DDRA0 PDIA7-PDIA0 DDRA7-DDRA0 Pin PA7-PA0
1. X = Don't care 2. U = Undefined
Technical Data 66 Parallel Input/Output (I/O)
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Parallel Input/Output (I/O) Port B
7.5 Port B
Port B is a 6-bit, general-purpose, bidirectional I/O port with programmable pulldown devices.
7.5.1 Port B Data Register The port B data register (PORTB) contains a bit for each of the port B pins. When a port B pin is programmed to be an output, the state of its data register bit determines the state of the output pin. When a port B pin is programmed to be an input, reading the port B data register returns the logic state of the pin.
Address: $0001 Bit 7 Read: Write: Reset: = Unimplemented Unaffected by reset 0 6 0 PB5 PB4 PB3 PB2 PB1 PB0 5 4 3 2 1 Bit 0
Figure 7-5. Port B Data Register (PORTB) PB5-PB0 -- Port B Data Bits These read/write bits are software programmable. Data direction of each bit is under the control of the corresponding bit in the port B data direction register. Bits 7 and 6 -- Not used Bits 7 and 6 always read as logic 0s. Writes to these bits have no effect.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Parallel Input/Output (I/O)
Technical Data 67
Parallel Input/Output (I/O)
7.5.2 Data Direction Register B The contents of data direction register B (DDRB) determine whether each port B pin is an input or an output. Writing a logic 1 to a DDRB bit enables the output buffer for the associated port B pin; a logic 0 disables the output buffer. A reset initializes all DDRB bits to logic 0, configuring all port B pins as inputs.
Address: $0005 Bit 7 Read: Write: Reset: 0 0 0 0 0 0 0 0 0 6 0 DDRB5 DDRB4 DDRB3 DDRB2 DDRB1 DDRB0 5 4 3 2 1 Bit 0
= Unimplemented
Figure 7-6. Data Direction Register B (DDRB) DDRB5-DDRB0 -- Data Direction Bits These read/write bits control port B data direction. 1 = Corresponding port B pin configured as output 0 = Corresponding port B pin configured as input Bit 7 and 6 -- Not used Bits 7 and 6 always read as logic 0s. Writes to these bits have no effect.
NOTE:
Avoid glitches on port B pins by writing to the port B data register before changing DDRB bits from logic 0 to logic 1.
Technical Data 68 Parallel Input/Output (I/O)
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Parallel Input/Output (I/O) Port B
7.5.3 Pulldown Register B All port B pins have mask-optional, programmable pulldown devices that typically sink 100 A. Clearing any of the PDIB5-PDIB0 bits in pulldown register B (PDRB) turns on the pulldown devices. See Figure 7-7. Pulldown register B can turn on a port B pulldown device only when the port B pin is an input. Reset clears bits PDIB5-PDIB0, turning on the port B pulldown devices.
Address: $0011 Bit 7 Read: Write: Reset: PDIB5 0 = Unimplemented PDIB4 0 PDIB3 0 PDIB2 0 PDIB1 0 PDIB0 0 6 5 4 3 2 1 Bit 0
Figure 7-7. Pulldown Register B (PDRB) PDIB5-PDIB0 -- Pulldown Inhibit Bits Writing logic 0s to these write-only bits turns on the port B pulldown devices. Reading pulldown register B returns undefined data. 1 = Corresponding port B pin pulldown device turned off 0 = Corresponding port B pin pulldown device turned on Bits 7 and 6 -- Not used
NOTE:
Avoid a floating port B input by clearing its pulldown register bit before changing its DDRB bit from logic 1 to logic 0. Do not use read-modify-write instructions on pulldown register B. Figure 7-8 shows the port B I/O logic. Reading a port B output actually reads the value of the data latch and not the voltage on the pin itself. When a port B pin is programmed as an input, reading the port bit reads the voltage level on the pin. The data latch can always be written, regardless of the state of its DDR bit. Table 7-2 summarizes the operation of the port B pins.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Parallel Input/Output (I/O)
Technical Data 69
Parallel Input/Output (I/O)
READ $0005 WRITE $0005
DATA DIRECTION REGISTER B BIT DDRBx
INTERNAL DATA BUS
WRITE $0001
PORT B DATA REGISTER BIT PBx
PBx
READ $0001
WRITE $0011
PULLDOWN REGISTER B BIT PDIBx 100-A PULLDOWN DEVICE PULLDOWN DEVICES ENABLED (MASK OPTION)
RESET
Figure 7-8. Port B I/O Circuit
Table 7-2. Port B Pin Functions
Pulldown Mask Option No No Yes Yes Yes Yes Control Bits PDIBx X(1) X 0 0 1 1 DDRBx 0 1 0 1 0 1 Input, hi-z Output Input, pulldown on Output, pulldown on Input, hi-z Output I/O Pin Mode Accesses to PDRB Read U (2) U U U U U Write Accesses to DDRB Read/Write Accesses to PORTB Read Pin Write PB7-PB0
PDIB7-PDIB0 DDRB7-DDRB0
PDIB7-PDIB0 DDRB7-DDRB0 PB7-PB0 PB7-PB0 PDIB7-PDIB0 DDRB7-DDRB0 Pin PB7-PB0
PDIB7-PDIB0 DDRB7-DDRB0 PB7-PB0 PB7-PB0 PDIB7-PDIB0 DDRB7-DDRB0 Pin PB7-PB0
PDIB7-PDIB0 DDRB7-DDRB0 PB7-PB0 PB7-PB0
1. X = Don't care 2. U = Undefined
Technical Data 70 Parallel Input/Output (I/O)
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Technical Data -- MC68HC05J1A
Section 8. Multifunction Timer
8.1 Contents
8.2 8.3 8.4 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Timer Status and Control Register . . . . . . . . . . . . . . . . . . . . . . 73 COP Watchdog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
8.2 Introduction
This section describes the operation of the multifunction timer and the computer operating properly (COP) watchdog. Figure 8-1 shows the organization of the timer subsystem.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Multifunction Timer
Technical Data 71
Multifunction Timer
INTERNAL DATA BUS OVERFLOW
TIMER COUNTER REGISTER ($0009) LEAST SIGNIFICANT 8 BITS OF 15-STAGE RIPPLE COUNTER
/4
INTERNAL CLOCK (XTAL / 2)
INTERNAL DATA BUS
INTERRUPT REQUEST
TIMER STATUS/CONTROL REGISTER ($0008) RT1 RTI RATE SELECT POWER-ON RESET (POR) RT0
/2
/2
/2
/2
RTIFR
TOFR
TOIE
RTIE
RTIF
TOF
/2
/2
/2
MOST SIGNIFICANT 7 BITS OF 15-STAGE RIPPLE COUNTER
/2
/2
/2
S
Q
COP WATCHDOG RESET
CLEAR COP WATCHDOG
R
Figure 8-1. Multifunction Timer Block Diagram
Technical Data 72 Multifunction Timer
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Multifunction Timer Timer Status and Control Register
8.3 Timer Status and Control Register
The read/write timer status and control register (TSCR) contains these bits: * * * *
Address:
Timer interrupt enable bits Timer interrupt flags Timer interrupt flag reset bits Timer interrupt rate select bits
$0008 Bit 7 6 RTIF TOIE RTIE TOFR 0 0 0 0 0 RTIFR 0 1 1 5 4 3 0 2 0 RT1 RT0 1 Bit 0
Read: Write: Reset:
TOF
= Unimplemented
Figure 8-2. Timer Status and Control Register (TSCR) TOF -- Timer Overflow Flag This read-only flag becomes set when the first eight stages of the counter roll over from $FF to $00. TOF generates a timer overflow interrupt request if TOIE is also set. Clear TOF by writing a logic 1 to the TOFR bit. Writing to TOF has no effect. Reset clears TOF. RTIF -- Real-Time Interrupt Flag This read-only flag becomes set when the selected real-time interrupt (RTI) output becomes active. RTIF generates a real-time interrupt request if RTIE is also set. Clear RTIF by writing a logic 1 to the RTIFR bit. Writing to RTIF has no effect. Reset clears RTIF. TOIE -- Timer Overflow Interrupt Enable Bit This read/write bit enables timer overflow interrupts. 1 = Timer overflow interrupts enabled 0 = Timer overflow interrupts disabled
MC68HC05J1A -- Rev. 3.0 MOTOROLA Multifunction Timer
Technical Data 73
Multifunction Timer
RTIE -- Real-Time Interrupt Enable Bit This read/write bit enables real-time interrupts. 1 = Real-time interrupts enabled 0 = Real-time interrupts disabled TOFR -- Timer Overflow Flag Reset Bit Writing a logic 1 to this write-only bit clears the TOF bit. TOFR always reads as logic 0. Reset clears TOFR. RTIFR -- Real-Time Interrupt Flag Reset Bit Writing a logic 1 to this write-only bit clears the RTIF bit. RTIFR always reads as logic 0. Reset clears RTIFR. RT1 and RT0 -- Real-Time Interrupt Select Bits 1 and 0 These read/write bits select one of four RTI rates, as shown in Table 8-1. Because the selected RTI output drives the COP watchdog, changing the real-time interrupt rate also changes the counting rate of the COP watchdog. Reset sets RT1 and RT0.
NOTE:
Changing RT1 and RT0 when a COP timeout is imminent or uncertain may cause a real-time interrupt request to be missed or an additional real-time interrupt request to be generated. Clear the COP timer just before changing RT1 and RT0. Table 8-1. Real-Time Interrupt Rate Selection
RT1:RT0 00 01 10 11 Number of Cycles to RTI 214 = 16,384 215 = 32,768 216 = 65,536 217 = 131,072 RTI Period(1) 8.2 ms 16.4 ms 32.8 ms 65.5 ms Number of Cycles to COP Reset 217 = 131,072 218 = 262,144 219 = 524,288 220 = 1,048,576 COP Timeout Period(1) 65.5 ms 131.1 ms 262.1 ms 524.3 ms
1. At 2-MHz bus, 4-MHz XTAL, 0.5 s per cycle
Technical Data 74 Multifunction Timer
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Multifunction Timer Timer Status and Control Register
A 15-stage ripple counter is the core of the timer. The value of the first eight stages is readable at any time from the read-only timer counter register (TCNTR).
Address: $0009 Bit 7 Read: Write: Reset: 0 0 0 0 0 0 0 0 Bit 7 6 Bit 6 5 Bit 5 4 Bit 4 3 Bit 3 2 Bit 2 1 Bit 1 Bit 0 Bit 0
= Unimplemented
Figure 8-3. Timer Counter Register (TCNTR) Power-on clears the entire counter chain and begins clocking the counter. After 4064 cycles, the power-on reset circuit is released, clearing the counter again and allowing the MCU to come out of reset. A timer overflow function at the eighth counter stage allows a timer interrupt every 1024 internal clock cycles.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Multifunction Timer
Technical Data 75
Multifunction Timer 8.4 COP Watchdog
Four counter stages at the end of the timer make up the mask-optional computer operating properly (COP) watchdog. (See Figure 8-4.) The COP watchdog is a software error detection system that automatically times out and resets the MCU if not cleared periodically by a program sequence. Writing a logic 0 to bit 0 of the COP register clears the COP watchdog and prevents a COP reset.
Address: $07F0 Bit 7 Read: Write: Reset: U U U U U U U COPC 0 6 5 4 3 2 1 Bit 0
= Unimplemented
Figure 8-4. COP Register (COPR) COPC -- COP Clear Bit This write-only bit resets the COP watchdog. Reading address $07F0 returns the ROM data at that address.
NOTE:
The STOP instruction turns off the COP watchdog. In applications that depend on the COP watchdog, the STOP instruction can be disabled by a mask option.
Technical Data 76 Multifunction Timer
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Technical Data -- MC68HC05J1A
Section 9. Instruction Set
9.1 Contents
9.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
9.3 Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 9.3.1 Inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 9.3.2 Immediate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 9.3.3 Direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 9.3.4 Extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 9.3.5 Indexed, No Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 9.3.6 Indexed, 8-Bit Offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 9.3.7 Indexed, 16-Bit Offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 9.3.8 Relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 9.4 Instruction Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 9.4.1 Register/Memory Instructions. . . . . . . . . . . . . . . . . . . . . . . .82 9.4.2 Read-Modify-Write Instructions . . . . . . . . . . . . . . . . . . . . . . 83 9.4.3 Jump/Branch Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . 84 9.4.4 Bit Manipulation Instructions . . . . . . . . . . . . . . . . . . . . . . . .86 9.4.5 Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 9.5 9.6 Instruction Set Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Opcode Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
MC68HC05J1A -- Rev. 3.0 MOTOROLA Instruction Set
Technical Data 77
Instruction Set 9.2 Introduction
The microcontroller unit (MCU) instruction set has 62 instructions and uses eight addressing modes. The instructions include all those of the M146805 CMOS Family plus one more: the unsigned multiply (MUL) instruction. The MUL instruction allows unsigned multiplication of the contents of the accumulator (A) and the index register (X). The high-order product is stored in the index register, and the low-order product is stored in the accumulator.
9.3 Addressing Modes
The central processor unit (CPU) uses eight addressing modes for flexibility in accessing data. The addressing modes provide eight different ways for the CPU to find the data required to execute an instruction. The eight addressing modes are: * * * * * * * * Inherent Immediate Direct Extended Indexed, no offset Indexed, 8-bit offset Indexed, 16-bit offset Relative
Technical Data 78 Instruction Set
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Instruction Set Addressing Modes
9.3.1 Inherent Inherent instructions are those that have no operand, such as return from interrupt (RTI) and stop (STOP). Some of the inherent instructions act on data in the CPU registers, such as set carry flag (SEC) and increment accumulator (INCA). Inherent instructions require no operand address and are one byte long.
9.3.2 Immediate Immediate instructions are those that contain a value to be used in an operation with the value in the accumulator or index register. Immediate instructions require no operand address and are two bytes long. The opcode is the first byte, and the immediate data value is the second byte.
9.3.3 Direct Direct instructions can access any of the first 256 memory locations with two bytes. The first byte is the opcode, and the second is the low byte of the operand address. In direct addressing, the CPU automatically uses $00 as the high byte of the operand address.
9.3.4 Extended Extended instructions use three bytes and can access any address in memory. The first byte is the opcode; the second and third bytes are the high and low bytes of the operand address. When using the Motorola assembler, the programmer does not need to specify whether an instruction is direct or extended. The assembler automatically selects the shortest form of the instruction.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Instruction Set
Technical Data 79
Instruction Set
9.3.5 Indexed, No Offset Indexed instructions with no offset are 1-byte instructions that can access data with variable addresses within the first 256 memory locations. The index register contains the low byte of the effective address of the operand. The CPU automatically uses $00 as the high byte, so these instructions can address locations $0000-$00FF. Indexed, no offset instructions are often used to move a pointer through a table or to hold the address of a frequently used RAM or I/O location.
9.3.6 Indexed, 8-Bit Offset Indexed, 8-bit offset instructions are 2-byte instructions that can access data with variable addresses within the first 511 memory locations. The CPU adds the unsigned byte in the index register to the unsigned byte following the opcode. The sum is the effective address of the operand. These instructions can access locations $0000-$01FE. Indexed 8-bit offset instructions are useful for selecting the kth element in an n-element table. The table can begin anywhere within the first 256 memory locations and could extend as far as location 510 ($01FE). The k value is typically in the index register, and the address of the beginning of the table is in the byte following the opcode.
9.3.7 Indexed, 16-Bit Offset Indexed, 16-bit offset instructions are 3-byte instructions that can access data with variable addresses at any location in memory. The CPU adds the unsigned byte in the index register to the two unsigned bytes following the opcode. The sum is the effective address of the operand. The first byte after the opcode is the high byte of the 16-bit offset; the second byte is the low byte of the offset. Indexed, 16-bit offset instructions are useful for selecting the kth element in an n-element table anywhere in memory. As with direct and extended addressing, the Motorola assembler determines the shortest form of indexed addressing.
Technical Data 80 Instruction Set MC68HC05J1A -- Rev. 3.0 MOTOROLA
Instruction Set Instruction Types
9.3.8 Relative Relative addressing is only for branch instructions. If the branch condition is true, the CPU finds the effective branch destination by adding the signed byte following the opcode to the contents of the program counter. If the branch condition is not true, the CPU goes to the next instruction. The offset is a signed, two's complement byte that gives a branching range of -128 to +127 bytes from the address of the next location after the branch instruction. When using the Motorola assembler, the programmer does not need to calculate the offset, because the assembler determines the proper offset and verifies that it is within the span of the branch.
9.4 Instruction Types
The MCU instructions fall into five categories: * * * * * Register/memory instructions Read-modify-write instructions Jump/branch instructions Bit manipulation instructions Control instructions
MC68HC05J1A -- Rev. 3.0 MOTOROLA Instruction Set
Technical Data 81
Instruction Set
9.4.1 Register/Memory Instructions These instructions operate on CPU registers and memory locations. Most of them use two operands. One operand is in either the accumulator or the index register. The CPU finds the other operand in memory. Table 9-1. Register/Memory Instructions
Instruction Add memory byte and carry bit to accumulator Add memory byte to accumulator AND memory byte with accumulator Bit test accumulator Compare accumulator Compare index register with memory byte Exclusive OR accumulator with memory byte Load accumulator with memory byte Load Index register with memory byte Multiply OR accumulator with memory byte Subtract memory byte and carry bit from accumulator Store accumulator in memory Store index register in memory Subtract memory byte from accumulator Mnemonic ADC ADD AND BIT CMP CPX EOR LDA LDX MUL ORA SBC STA STX SUB
Technical Data 82 Instruction Set
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Instruction Set Instruction Types
9.4.2 Read-Modify-Write Instructions These instructions read a memory location or a register, modify its contents, and write the modified value back to the memory location or to the register.
NOTE:
Do not use read-modify-write operations on write-only registers. Table 9-2. Read-Modify-Write Instructions
Instruction Arithmetic shift left (same as LSL) Arithmetic shift right Bit clear Bit set Clear register Complement (one's complement) Decrement Increment Logical shift left (same as ASL) Logical shift right Negate (two's complement) Rotate left through carry bit Rotate right through carry bit Test for negative or zero Mnemonic ASL ASR BCLR(1) BSET(1) CLR COM DEC INC LSL LSR NEG ROL ROR TST(2)
1. Unlike other read-modify-write instructions, BCLR and BSET use only direct addressing. 2. TST is an exception to the read-modify-write sequence because it does not write a replacement value.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Instruction Set
Technical Data 83
Instruction Set
9.4.3 Jump/Branch Instructions Jump instructions allow the CPU to interrupt the normal sequence of the program counter. The unconditional jump instruction (JMP) and the jump-to-subroutine instruction (JSR) have no register operand. Branch instructions allow the CPU to interrupt the normal sequence of the program counter when a test condition is met. If the test condition is not met, the branch is not performed. The BRCLR and BRSET instructions cause a branch based on the state of any readable bit in the first 256 memory locations. These 3-byte instructions use a combination of direct addressing and relative addressing. The direct address of the byte to be tested is in the byte following the opcode. The third byte is the signed offset byte. The CPU finds the effective branch destination by adding the third byte to the program counter if the specified bit tests true. The bit to be tested and its condition (set or clear) is part of the opcode. The span of branching is from -128 to +127 from the address of the next location after the branch instruction. The CPU also transfers the tested bit to the carry/borrow bit of the condition code register.
Technical Data 84 Instruction Set
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Instruction Set Instruction Types
Table 9-3. Jump and Branch Instructions
Instruction Branch if carry bit clear Branch if carry bit set Branch if equal Branch if half-carry bit clear Branch if half-carry bit set Branch if higher Branch if higher or same Branch if IRQ pin high Branch if IRQ pin low Branch if lower Branch if lower or same Branch if interrupt mask clear Branch if minus Branch if interrupt mask set Branch if not equal Branch if plus Branch always Branch if bit clear Branch never Branch if bit set Branch to subroutine Unconditional jump Jump to subroutine Mnemonic BCC BCS BEQ BHCC BHCS BHI BHS BIH BIL BLO BLS BMC BMI BMS BNE BPL BRA BRCLR BRN BRSET BSR JMP JSR
MC68HC05J1A -- Rev. 3.0 MOTOROLA Instruction Set
Technical Data 85
Instruction Set
9.4.4 Bit Manipulation Instructions The CPU can set or clear any writable bit in the first 256 bytes of memory, which includes I/O registers and on-chip RAM locations. The CPU can also test and branch based on the state of any bit in any of the first 256 memory locations. Table 9-4. Bit Manipulation Instructions
Instruction Bit clear Branch if bit clear Branch if bit set Bit set Mnemonic BCLR BRCLR BRSET BSET
Technical Data 86 Instruction Set
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Instruction Set Instruction Types
9.4.5 Control Instructions These instructions act on CPU registers and control CPU operation during program execution. Table 9-5. Control Instructions
Instruction Clear carry bit Clear interrupt mask No operation Reset stack pointer Return from interrupt Return from subroutine Set carry bit Set interrupt mask Stop oscillator and enable IRQ pin Software interrupt Transfer accumulator to index register Transfer index register to accumulator Stop CPU clock and enable interrupts Mnemonic CLC CLI NOP RSP RTI RTS SEC SEI STOP SWI TAX TXA
WAIT
MC68HC05J1A -- Rev. 3.0 MOTOROLA Instruction Set
Technical Data 87
Instruction Set 9.5 Instruction Set Summary
Table 9-6. Instruction Set Summary (Sheet 1 of 6)
Opcode Source Form
ADC ADC ADC ADC ADC ADC ADD ADD ADD ADD ADD ADD #opr opr opr opr,X opr,X ,X #opr opr opr opr,X opr,X ,X
Operation
Description
H I NZC
Add with Carry
A (A) + (M) + (C)
--
IMM DIR EXT IX2 IX1 IX IMM DIR EXT IX2 IX1 IX IMM DIR EXT IX2 IX1 IX DIR INH INH IX1 IX DIR INH INH IX1 IX REL
ii A9 2 B9 dd 3 C9 hh ll 4 D9 ee ff 5 E9 ff 4 F9 3 AB ii 2 BB dd 3 CB hh ll 4 DB ee ff 5 EB ff 4 FB 3 ii A4 2 B4 dd 3 C4 hh ll 4 D4 ee ff 5 E4 ff 4 F4 3 38 48 58 68 78 37 47 57 67 77 24 11 13 15 17 19 1B 1D 1F 25 27 28 29 22 24 dd 5 3 3 6 5 5 3 3 6 5 3 5 5 5 5 5 5 5 5 3 3 3 3 3 3
Add without Carry
A (A) + (M)
--
AND #opr AND opr AND opr AND opr,X AND opr,X AND ,X ASL opr ASLA ASLX ASL opr,X ASL ,X ASR opr ASRA ASRX ASR opr,X ASR ,X BCC rel
Logical AND
A (A) (M)
---- --
Arithmetic Shift Left (Same as LSL)
C b7 b0
0
----
ff dd
Arithmetic Shift Right
b7 b0
C
----
ff rr dd dd dd dd dd dd dd dd rr rr rr rr rr rr
Branch if Carry Bit Clear
PC (PC) + 2 + rel ? C = 0
----------
BCLR n opr
Clear Bit n
Mn 0
DIR (b0) DIR (b1) DIR (b2) DIR (b3) ---------- DIR (b4) DIR (b5) DIR (b6) DIR (b7) ---------- ---------- ---------- ---------- REL REL REL REL REL REL
BCS rel BEQ rel BHCC rel BHCS rel BHI rel BHS rel
Branch if Carry Bit Set (Same as BLO) Branch if Equal Branch if Half-Carry Bit Clear Branch if Half-Carry Bit Set Branch if Higher Branch if Higher or Same
PC (PC) + 2 + rel ? C = 1 PC (PC) + 2 + rel ? Z = 1 PC (PC) + 2 + rel ? H = 0 PC (PC) + 2 + rel ? H = 1 PC (PC) + 2 + rel ? C = 0
PC (PC) + 2 + rel ? C Z = 0 -- -- -- -- -- ----------
Technical Data 88 Instruction Set
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Cycles
Effect on CCR
Operand
Address Mode
Instruction Set Instruction Set Summary
Table 9-6. Instruction Set Summary (Sheet 2 of 6)
Address Mode Opcode Source Form
BIH rel BIL rel BIT #opr BIT opr BIT opr BIT opr,X BIT opr,X BIT ,X BLO rel BLS rel BMC rel BMI rel BMS rel BNE rel BPL rel BRA rel
Operation
Branch if IRQ Pin High Branch if IRQ Pin Low
Description
PC (PC) + 2 + rel ? IRQ = 1 PC (PC) + 2 + rel ? IRQ = 0
H I NZC
---------- ----------
REL REL IMM DIR EXT IX2 IX1 IX REL REL REL REL REL REL REL REL
2F 2E
rr rr
Bit Test Accumulator with Memory Byte
(A) (M)
---- --
ii A5 2 B5 dd 3 C5 hh ll 4 D5 ee ff 5 E5 ff 4 F5 3 25 23 2C 2B 2D 26 2A 20 01 03 05 07 09 0B 0D 0F 21 00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E rr rr rr rr rr rr rr rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd dd dd dd dd dd dd dd 3 3 3 3 3 3 3 3 5 5 5 5 5 5 5 5 3 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
Branch if Lower (Same as BCS) Branch if Lower or Same Branch if Interrupt Mask Clear Branch if Minus Branch if Interrupt Mask Set Branch if Not Equal Branch if Plus Branch Always
PC (PC) + 2 + rel ? C = 1 PC (PC) + 2 + rel ? I = 0 PC (PC) + 2 + rel ? N = 1 PC (PC) + 2 + rel ? I = 1 PC (PC) + 2 + rel ? Z = 0 PC (PC) + 2 + rel ? N = 0 PC (PC) + 2 + rel ? 1 = 1
----------
PC (PC) + 2 + rel ? C Z = 1 -- -- -- -- -- ---------- ---------- ---------- ---------- ---------- ----------
BRCLR n opr rel Branch if Bit n Clear
PC (PC) + 2 + rel ? Mn = 0
DIR (b0) DIR (b1) DIR (b2) DIR (b3) -------- DIR (b4) DIR (b5) DIR (b6) DIR (b7) ---------- REL
BRN rel
Branch Never
PC (PC) + 2 + rel ? 1 = 0
BRSET n opr rel Branch if Bit n Set
PC (PC) + 2 + rel ? Mn = 1
DIR (b0) DIR (b1) DIR (b2) DIR (b3) -------- DIR (b4) DIR (b5) DIR (b6) DIR (b7) DIR (b0) DIR (b1) DIR (b2) DIR (b3) ---------- DIR (b4) DIR (b5) DIR (b6) DIR (b7)
BSET n opr
Set Bit n
Mn 1
BSR rel
Branch to Subroutine
PC (PC) + 2; push (PCL) SP (SP) - 1; push (PCH) SP (SP) - 1 PC (PC) + rel C0 I0
----------
REL
AD
rr
CLC CLI
Clear Carry Bit Clear Interrupt Mask
-------- 0 -- 0 ------
INH INH
98 9A
MC68HC05J1A -- Rev. 3.0 MOTOROLA Instruction Set
Technical Data 89
Cycles
3 3 6 2 2
Effect on CCR
Operand
Instruction Set
Table 9-6. Instruction Set Summary (Sheet 3 of 6)
Address Mode Opcode Source Form
CLR opr CLRA CLRX CLR opr,X CLR ,X CMP #opr CMP opr CMP opr CMP opr,X CMP opr,X CMP ,X COM opr COMA COMX COM opr,X COM ,X CPX CPX CPX CPX CPX CPX #opr opr opr opr,X opr,X ,X
Operation
Description
M $00 A $00 X $00 M $00 M $00
H I NZC
Clear Byte
---- 0 1 --
DIR INH INH IX1 IX IMM DIR EXT IX2 IX1 IX DIR INH INH IX1 IX IMM DIR EXT IX2 IX1 IX DIR INH INH IX1 IX IMM DIR EXT IX2 IX1 IX DIR INH INH IX1 IX DIR EXT IX2 IX1 IX
3F 4F 5F 6F 7F
dd
ff
Compare Accumulator with Memory Byte
(A) - (M)
----
ii A1 2 B1 dd 3 C1 hh ll 4 D1 ee ff 5 E1 ff 4 F1 3 33 43 53 63 73 dd 5 3 3 6 5
Complement Byte (One's Complement)
M (M) = $FF - (M) A (A) = $FF - (A) X (X) = $FF - (X) M (M) = $FF - (M) M (M) = $FF - (M)
---- 1
ff
Compare Index Register with Memory Byte
(X) - (M)
----
ii A3 2 B3 dd 3 C3 hh ll 4 D3 ee ff 5 E3 ff 4 F3 3 3A 4A 5A 6A 7A dd 5 3 3 6 5
DEC opr DECA DECX DEC opr,X DEC ,X EOR EOR EOR EOR EOR EOR #opr opr opr opr,X opr,X ,X
Decrement Byte
M (M) - 1 A (A) - 1 X (X) - 1 M (M) - 1 M (M) - 1
---- --
ff
EXCLUSIVE OR Accumulator with Memory Byte
A (A) (M)
---- --
ii A8 2 B8 dd 3 C8 hh ll 4 D8 ee ff 5 E8 ff 4 F8 3 3C 4C 5C 6C 7C dd 5 3 3 6 5
INC opr INCA INCX INC opr,X INC ,X JMP opr JMP opr JMP opr,X JMP opr,X JMP ,X
Increment Byte
M (M) + 1 A (A) + 1 X (X) + 1 M (M) + 1 M (M) + 1
---- --
ff
Unconditional Jump
PC Jump Address
----------
BC dd 2 CC hh ll 3 DC ee ff 4 EC ff 3 FC 2
Technical Data 90 Instruction Set
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Cycles
5 3 3 6 5
Effect on CCR
Operand
Instruction Set Instruction Set Summary
Table 9-6. Instruction Set Summary (Sheet 4 of 6)
Address Mode Opcode Source Form
JSR opr JSR opr JSR opr,X JSR opr,X JSR ,X LDA #opr LDA opr LDA opr LDA opr,X LDA opr,X LDA ,X LDX #opr LDX opr LDX opr LDX opr,X LDX opr,X LDX ,X LSL opr LSLA LSLX LSL opr,X LSL ,X LSR opr LSRA LSRX LSR opr,X LSR ,X MUL NEG opr NEGA NEGX NEG opr,X NEG ,X NOP ORA ORA ORA ORA ORA ORA #opr opr opr opr,X opr,X ,X
Operation
Description
H I NZC
PC (PC) + n (n = 1, 2, or 3) Push (PCL); SP (SP) - 1 Push (PCH); SP (SP) - 1 PC Effective Address
Jump to Subroutine
----------
DIR EXT IX2 IX1 IX IMM DIR EXT IX2 IX1 IX IMM DIR EXT IX2 IX1 IX DIR INH INH IX1 IX DIR INH INH IX1 IX INH DIR INH INH IX1 IX INH IMM DIR EXT IX2 IX1 IX DIR INH INH IX1 IX
BD dd 5 CD hh ll 6 DD ee ff 7 ED ff 6 FD 5 ii A6 2 B6 dd 3 C6 hh ll 4 D6 ee ff 5 E6 ff 4 F6 3 AE ii 2 BE dd 3 CE hh ll 4 DE ee ff 5 EE ff 4 FE 3 38 48 58 68 78 34 44 54 64 74 42 30 40 50 60 70 9D dd dd 5 3 3 6 5 5 3 3 6 5 1 1 5 3 3 6 5 2
Load Accumulator with Memory Byte
A (M)
---- --
Load Index Register with Memory Byte
X (M)
---- --
Logical Shift Left (Same as ASL)
C b7 b0
0
----
ff dd
Logical Shift Right
0 b7 b0
C
---- 0
ff
Unsigned Multiply
X : A (X) x (A) M -(M) = $00 - (M) A -(A) = $00 - (A) X -(X) = $00 - (X) M -(M) = $00 - (M) M -(M) = $00 - (M)
0 ------ 0
Negate Byte (Two's Complement)
----
ff
No Operation
----------
Logical OR Accumulator with Memory
A (A) (M)
---- --
AA ii 2 BA dd 3 CA hh ll 4 DA ee ff 5 EA ff 4 FA 3 39 49 59 69 79 dd 5 3 3 6 5
ROL opr ROLA ROLX ROL opr,X ROL ,X
Rotate Byte Left through Carry Bit
C b7 b0
----
ff
MC68HC05J1A -- Rev. 3.0 MOTOROLA Instruction Set
Technical Data 91
Cycles
Effect on CCR
Operand
Instruction Set
Table 9-6. Instruction Set Summary (Sheet 5 of 6)
Address Mode Opcode Source Form
ROR opr RORA RORX ROR opr,X ROR ,X RSP
Operation
Description
H I NZC
Rotate Byte Right through Carry Bit
b7 b0
C
----
DIR INH INH IX1 IX INH
36 46 56 66 76 9C
dd
ff
Reset Stack Pointer
SP $00FF SP (SP) + 1; Pull (CCR) SP (SP) + 1; Pull (A) SP (SP) + 1; Pull (X) SP (SP) + 1; Pull (PCH) SP (SP) + 1; Pull (PCL) SP (SP) + 1; Pull (PCH) SP (SP) + 1; Pull (PCL)
----------
RTI
Return from Interrupt
INH
80
RTS SBC #opr SBC opr SBC opr SBC opr,X SBC opr,X SBC ,X SEC SEI STA opr STA opr STA opr,X STA opr,X STA ,X STOP STX opr STX opr STX opr,X STX opr,X STX ,X SUB SUB SUB SUB SUB SUB #opr opr opr opr,X opr,X ,X
Return from Subroutine
----------
INH IMM DIR EXT IX2 IX1 IX INH INH DIR EXT IX2 IX1 IX INH DIR EXT IX2 IX1 IX IMM DIR EXT IX2 IX1 IX
81
Subtract Memory Byte and Carry Bit from Accumulator
A (A) - (M) - (C)
----
ii A2 2 B2 dd 3 C2 hh ll 4 D2 ee ff 5 E2 ff 4 F2 3 99 9B 2 2
Set Carry Bit Set Interrupt Mask
C1 I1
-------- 1 -- 1 ------
Store Accumulator in Memory
M (A)
---- --
B7 dd 4 C7 hh ll 5 D7 ee ff 6 E7 ff 5 F7 4 8E 2
Stop Oscillator and Enable IRQ Pin
-- 0 ------
Store Index Register In Memory
M (X)
---- --
BF dd 4 CF hh ll 5 DF ee ff 6 EF ff 5 FF 4 ii A0 2 B0 dd 3 C0 hh ll 4 D0 ee ff 5 E0 ff 4 F0 3
Subtract Memory Byte from Accumulator
A (A) - (M)
----
SWI
Software Interrupt
PC (PC) + 1; Push (PCL) SP (SP) - 1; Push (PCH) SP (SP) - 1; Push (X) SP (SP) - 1; Push (A) -- 1 ------ SP (SP) - 1; Push (CCR) SP (SP) - 1; I 1 PCH Interrupt Vector High Byte PCL Interrupt Vector Low Byte X (A) ----------
INH
83
TAX
Transfer Accumulator to Index Register
INH
97
Technical Data 92 Instruction Set
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Cycles
5 3 3 6 5 2 9 6 1 0 2
Effect on CCR
Operand
Instruction Set Opcode Map
Table 9-6. Instruction Set Summary (Sheet 6 of 6)
Address Mode Opcode Source Form
TST opr TSTA TSTX TST opr,X TST ,X TXA WAIT A C CCR dd dd rr DIR ee ff EXT ff H hh ll I ii IMM INH IX IX1 IX2 M N n
Operation
Description
H I NZC
Test Memory Byte for Negative or Zero
(M) - $00
---- --
DIR INH INH IX1 IX INH INH
3D 4D 5D 6D 7D 9F 8F
dd
ff
Transfer Index Register to Accumulator Stop CPU Clock and Enable Interrupts Accumulator Carry/borrow flag Condition code register Direct address of operand Direct address of operand and relative offset of branch instruction Direct addressing mode High and low bytes of offset in indexed, 16-bit offset addressing Extended addressing mode Offset byte in indexed, 8-bit offset addressing Half-carry flag High and low bytes of operand address in extended addressing Interrupt mask Immediate operand byte Immediate addressing mode Inherent addressing mode Indexed, no offset addressing mode Indexed, 8-bit offset addressing mode Indexed, 16-bit offset addressing mode Memory location Negative flag Any bit
A (X)
---------- -- 0 ------ opr PC PCH PCL REL rel rr SP X Z # () -( ) ? :
--
Operand (one or two bytes) Program counter Program counter high byte Program counter low byte Relative addressing mode Relative program counter offset byte Relative program counter offset byte Stack pointer Index register Zero flag Immediate value Logical AND Logical OR Logical EXCLUSIVE OR Contents of Negation (two's complement) Loaded with If Concatenated with Set or cleared Not affected
9.6 Opcode Map
See Table 9-7.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Instruction Set
Technical Data 93
Cycles
4 3 3 5 4 2 2
Effect on CCR
Operand
Instruction Set
94 Instruction Set MOTOROLA
Technical Data MC68HC05J1A -- Rev. 3.0
Table 9-7. Opcode Map
Bit Manipulation DIR
MSB LSB
Branch REL 2 DIR 3
Read-Modify-Write INH 4 INH 5 IX1 6 IX 7
Control INH 8
9 RTI INH 6 RTS INH
Register/Memory IMM A
2 SUB IMM 2 CMP IMM 2 SBC IMM 2 CPX IMM 2 AND IMM 2 BIT IMM 2 LDA IMM
DIR 1
INH 9
DIR B
3 SUB DIR 3 CMP DIR 3 SBC DIR 3 CPX DIR 3 AND DIR 3 BIT DIR 3 LDA DIR 4 STA DIR 3 EOR DIR 3 ADC DIR 3 ORA DIR 3 ADD DIR 2 JMP DIR 5 JSR DIR 3 LDX DIR 4 STX DIR
EXT C
4 SUB EXT 4 CMP EXT 4 SBC EXT 4 CPX EXT 4 AND EXT 4 BIT EXT 4 LDA EXT 5 STA EXT 4 EOR EXT 4 ADC EXT 4 ORA EXT 4 ADD EXT 3 JMP EXT 6 JSR EXT 4 LDX EXT 5 STX EXT
IX2 D
5 SUB IX2 5 CMP IX2 5 SBC IX2 5 CPX IX2 5 AND IX2 5 BIT IX2 5 LDA IX2 6 STA IX2 5 EOR IX2 5 ADC IX2 5 ORA IX2 5 ADD IX2 4 JMP IX2 7 JSR IX2 5 LDX IX2 6 STX IX2
IX1 E
4 SUB IX1 1 4 CMP IX1 1 4 SBC IX1 1 4 CPX IX1 1 4 AND IX1 1 4 BIT IX1 1 4 LDA IX1 1 5 STA IX1 1 4 EOR IX1 1 4 ADC IX1 1 4 ORA IX1 1 4 ADD IX1 1 3 JMP IX1 1 6 JSR IX1 1 4 LDX IX1 1 5 STX IX1 1
IX F
3 SUB IX 3 CMP IX 3 SBC IX 3 CPX IX 3 AND IX 3 BIT IX 3 LDA IX 4 STA IX 3 EOR IX 3 ADC IX 3 ORA IX 3 ADD IX 2 JMP IX 5 JSR IX 3 LDX IX 4 STX IX MSB LSB
0
0 1 2 3 4 5 6 7 8 9 A B C D E F
5 5 BSET0 BRSET0 DIR 3 DIR 2 5 5 BCLR0 BRCLR0 DIR 3 DIR 2 5 5 BSET1 BRSET1 DIR 3 DIR 2 5 5 BCLR1 BRCLR1 DIR 3 DIR 2 5 5 BSET2 BRSET2 DIR 3 DIR 2 5 5 BCLR2 BRCLR2 DIR 3 DIR 2 5 5 BSET3 BRSET3 DIR 3 DIR 2 5 5 BCLR3 BRCLR3 DIR 3 DIR 2 5 5 BSET4 BRSET4 DIR 3 DIR 2 5 5 BCLR4 BRCLR4 DIR 3 DIR 2 5 5 BSET5 BRSET5 DIR 3 DIR 2 5 5 BCLR5 BRCLR5 DIR 3 DIR 2 5 5 BSET6 BRSET6 DIR 3 DIR 2 5 5 BCLR6 BRCLR6 DIR 3 DIR 2 5 5 BSET7 BRSET7 DIR 3 DIR 2 5 5 BCLR7 BRCLR7 DIR 3 DIR 2
5 6 3 3 5 3 NEG NEG NEGX NEGA NEG BRA IX 1 IX1 1 INH 2 INH 1 DIR 1 REL 2 3 BRN 2 REL 1 3 11 BHI MUL 2 REL 1 INH 5 6 3 3 5 3 COM COM COMX COMA COM BLS IX 1 IX1 1 INH 2 INH 1 DIR 1 2 REL 2 5 6 3 3 5 3 LSR LSR LSRX LSRA LSR BCC IX IX1 1 INH 2 INH 1 DIR 1 2 REL 2 3 BCS/BLO 2 REL 5 6 3 3 5 3 ROR ROR RORX RORA ROR BNE IX IX1 1 INH 2 INH 1 DIR 1 2 REL 2 5 6 3 3 5 3 ASR ASR ASRX ASRA ASR BEQ IX IX1 1 INH 2 INH 1 DIR 1 2 REL 2 5 6 3 3 5 3 ASL/LSL ASLA/LSLA ASLX/LSLX ASL/LSL ASL/LSL BHCC IX IX1 1 INH 2 INH 1 DIR 1 2 REL 2 5 6 3 3 5 3 ROL ROL ROLX ROLA ROL BHCS IX IX1 1 INH 2 INH 1 DIR 1 2 REL 2 5 6 3 3 5 3 DEC DEC DECX DECA DEC BPL IX IX1 1 INH 2 INH 1 DIR 1 2 REL 2 3 BMI 2 REL 5 6 3 3 5 3 INC INC INCX INCA INC BMC IX IX1 1 INH 2 INH 1 DIR 1 2 REL 2 4 5 3 3 4 3 TST TST TSTX TSTA TST BMS IX IX1 1 INH 2 INH 1 DIR 1 2 REL 2 3 BIL 2 REL 1 5 6 3 3 5 3 CLR CLR CLRX CLRA CLR BIH IX 1 IX1 1 INH 2 INH 1 DIR 1 2 REL 2 2
0 1 2 3 4 5 6 7 8 9 A B C D E F
2 2 2
2 2 2 2 2 2 2 2
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
10 SWI INH
2 2 2 2 1 1 1 1 1 1 1 2 TAX INH 2 CLC INH 2 SEC INH 2 CLI INH 2 SEI INH 2 RSP INH 2 NOP INH
2 EOR IMM 2 ADC 2 IMM 2 ORA 2 IMM 2 ADD 2 IMM 2
2 2 2 2 2
2 STOP INH 2 2 TXA WAIT INH INH 1
6 BSR 2 REL 2 2 LDX 2 IMM 2 2 MSB LSB
INH = Inherent IMM = Immediate DIR = Direct EXT = Extended
REL = Relative IX = Indexed, No Offset IX1 = Indexed, 8-Bit Offset IX2 = Indexed, 16-Bit Offset
0
MSB of Opcode in Hexadecimal
LSB of Opcode in Hexadecimal
0
5 Number of Cycles BRSET0 Opcode Mnemonic 3 DIR Number of Bytes/Addressing Mode
Technical Data -- MC68HC05J1A
Section 10. Electrical Specifications
10.1 Contents
10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Maximum Ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Operating Temperature Range. . . . . . . . . . . . . . . . . . . . . . . . . 97 Thermal Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Power Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 5.0-Volt DC Electrical Characteristics. . . . . . . . . . . . . . . . . . . .99 3.3-Volt DC Electrical Characteristics. . . . . . . . . . . . . . . . . . .100 5.0-Volt Control Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
10.10 3.3-Volt Control Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
10.2 Introduction
This section contains electrical and timing specifications.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Electrical Specifications
Technical Data 95
Electrical Specifications 10.3 Maximum Ratings
Maximum ratings are the extreme limits to which the MCU can be exposed without permanently damaging it. The MCU contains circuitry to protect the inputs against damage from high static voltages; however, do not apply voltages higher than those shown in the table here. Keep VIn and VOut within the range VSS (VIn or VOut) VDD. Connect unused inputs to the appropriate voltage level, either VSS or VDD.
Rating(1) Supply voltage Input voltage Current drain per pin excluding VDD and VSS Storage temperature range
1. Voltages referenced to VSS
Symbol VDD VIn I TSTG
Value -0.3 to +7.0 VSS -0.3 to VDD +0.3 25 -65 to +150
Unit V V mA C
NOTE:
This device is not guaranteed to operate properly at the maximum ratings. Refer to 10.7 5.0-Volt DC Electrical Characteristics and 10.8 3.3-Volt DC Electrical Characteristics for guaranteed operating conditions.
Technical Data 96 Electrical Specifications
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Electrical Specifications Operating Temperature Range
10.4 Operating Temperature Range
Rating Operating temperature range MC68HC05J1AP(1), DW (2) MC68HC05J1AC(3)P, CDW MC68HC05J1AV(4)P MC68HC05J1AVDW Symbol Value Unit
TA
0 to +70 -40 to +85 -40 to +105 -40 to +105
C
1. P = Plastic dual in-line package (PDIP) 2. DW = Small outline integrated circuit (SOIC) 3. C = Extended temperature range (-40C to +85C) 4. V = Automotive temperature range (-40C to +105C)
10.5 Thermal Characteristics
Characteristic Maximum junction temperature Thermal resistance MC68HC05J1AP(1) MC68HC05J1ADW (2)
1. P = Plastic dual in-line package (PDIP) 2. DW = Small outline integrated circuit (SOIC)
Symbol TJ JA
Value 150
Unit C C/W
68 85
MC68HC05J1A -- Rev. 3.0 MOTOROLA Electrical Specifications
Technical Data 97
Electrical Specifications 10.6 Power Considerations
The average chip junction temperature, TJ, in C can be obtained from: TJ = TA + (PD x JA) (1)
Where: TA = ambient temperature in C JA = package thermal resistance, junction to ambient in C/W PD = PINT + PI/O PINT = ICC x VCC = chip internal power dissipation PI/O = power dissipation on input and output pins (user-determined) For most applications, PI/O < PINT and can be neglected. Ignoring PI/O, the relationship between PD and TJ is approximately: K PD = (2) TJ + 273C Solving equations (1) and (2) for K gives: = PD x (TA + 273C) + JA x (PD)2 (3)
where K is a constant pertaining to the particular part. K can be determined from equation (3) by measuring PD (at equilibrium) for a known TA. Using this value of K, the values of PD and TJ can be obtained by solving equations (1) and (2) iteratively for any value of TA.
Technical Data 98 Electrical Specifications
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Electrical Specifications 5.0-Volt DC Electrical Characteristics
10.7 5.0-Volt DC Electrical Characteristics
Characteristic(1) Output voltage ILoad = 10.0 A ILoad = -10.0 A Output high voltage PA7-PA0, PB5-PB0 (ILoad = -0.8 mA) Output low voltage PA3-PA0, PB5-PB0 (ILoad = 1.6 mA) PA7-PA4 (ILoad = 8.0 mA) Input high voltage PA7-PA0, PB5-PB0, IRQ, RESET, OSC1 Input low voltage PA7-PA0, PB5-PB0, IRQ, RESET, OSC1 Supply current Run(2) Wait(3) Stop(4) 25C -40C to +85C I/O ports hi-z leakage current PA7-PA0, PB5-PB0 (pulldown device off) Input pulldown current PA7-PA0, PB5-PB0 (pulldown device on) Input current RESET, IRQ, OSC1 Capacitance PA7-PA0, PB5-PB0 (input or output) RESET, IRQ, OSC1, OSC2 Oscillator internal resistor (Crystal/ceramic resonator mask option) Symbol VOL VOH VOH Min Typ Max Unit
-- VDD - 0.1 VDD - 0.8
-- -- --
0.1 -- --
V
V
VOL
-- -- 0.7 x VDD VSS
-- -- -- --
0.4 0.4 VDD 0.2 x VDD
V
VIH VIL
V V
IDD
-- -- -- --
3.0 1.6 0.2 2.0 -- 100 --
4.0 2.5 10 20 10 200 1
mA mA A A A A A
IIL IIL IIn
-- 50 --
COut CIn Rosc
-- -- 1.0
-- -- 2.0
12 8 3.0
pF
M
1. VDD = 5.0 Vdc 10%; VSS = 0 Vdc; TA = -40C to +85C; values reflect average measurements at midpoint of voltage range at 25C 2. Run (operating) IDD measured using external square wave clock source (fOSC = 4.2 MHz) with all inputs 0.2 V from rail. No dc loads. Less than 50 pF on all outputs. CL = 20 pF on OSC2. 3. Wait IDD measured using external square wave clock source (fOSC = 4.2 MHz) with all inputs 0.2 V from rail and only the timer active. No dc loads. Less than 50 pF on all outputs. CL = 20 pF on OSC2. All ports configured as inputs. VIL = 0.2 V. VIH = VDD - 0.2 V. OSC2 capacitance linearly affects wait IDD. 4. Stop IDD measured with OSC1 = V SS. All ports configured as inputs. VIL = 0.2 V. V IH = VDD - 0.2 V.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Electrical Specifications
Technical Data 99
Electrical Specifications 10.8 3.3-Volt DC Electrical Characteristics
Characteristic(1) Output voltage ILoad 10.0 A ILoad -10.0 A Output high voltage PA7-PA0, PB5-PB0 (ILoad = -0.2 mA) Output low voltage PA3-PA0 (ILoad = -0.4 mA) PA7-PA4 (ILoad = 5.0 mA) Input high voltage PA7-PA0, PB5-PB0, IRQ, RESET, OSC1 Input low voltage PA7-PA0, PB5-PB0, IRQ, RESET, OSC1 Supply current Run(2) Wait(3) Stop(4) 25C -40C to +85C I/O ports hi-z leakage current PA7-PA0, PB5-PB0 (pulldown device off) Input pulldown current PA7-PA0, PB5-PB0 (pulldown device on) Input current RESET, IRQ, OSC1 Capacitance PA7-PA0, PB5-PB0 (input or output) RESET, IRQ, OSC1, OSC2 Oscillator internal resistor (Crystal/ceramic resonator mask option) Symbol VOL VOH VOH Min Typ Max Unit
-- VDD - 0.1 VDD - 0.3
-- -- --
0.1 -- --
V
V
VOL
-- -- 0.7 x VDD VSS
-- -- -- --
0.3 0.3 VDD 0.2 x VDD
V
VIH VIL
V V
IDD
-- -- -- --
1.0 0.5 0.1 1 -- 40 --
2.0 1.0 5 10 10 100 1
mA mA A A A A A
IIL IIL IIn
-- 20 --
COut CIn Rosc
-- -- 1.0
-- -- 2.0
12 8 3.0
pF
M
1. VDD = 3.3 Vdc 10%; VSS = 0 Vdc; TA = -40C to +85C; values reflect average measurements at midpoint of voltage range at 25C 2. Run (operating) IDD measured using external square wave clock source (fOSC = 2.0 MHz) with all inputs 0.2 V from rail. No dc loads. Less than 50 pF on all outputs. CL = 20 pF on OSC2. 3. Wait IDD measured using external square wave clock source (fOSC = 2.0 MHz) with all inputs 0.2 V from rail and only the timer active. No dc loads. Less than 50 pF on all outputs. CL = 20 pF on OSC2. All ports configured as inputs. VIL = 0.2 V. VIH = VDD - 0.2 V. OSC2 capacitance linearly affects wait IDD. 4. Stop IDD measured with OSC1 = V SS. All ports configured as inputs. VIL = 0.2 V. V IH = VDD - 0.2 V.
Technical Data 100 Electrical Specifications
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Electrical Specifications 3.3-Volt DC Electrical Characteristics
4.20
4.30
4.40
4.50 VOH (V)
4.60
4.70
4.80
85C 25C -40C
4.90
5.00 0.00 -1.00 -2.00 IOH (mA) -3.00 -4.00 -5.00
Figure 10-1. Typical VOH/IOH (VDD = 5.0 V)
2.55
2.65
2.75
2.85 VOH (V)
2.95
3.05
3.15
85C 25C -40C
3.25
3.35 0.00 -1.00 -2.00 IOH (mA) -3.00 -4.00 -5.00
Figure 10-2. Typical VOH/IOH (VDD = 3.3 V)
MC68HC05J1A -- Rev. 3.0 MOTOROLA Electrical Specifications Technical Data 101
Electrical Specifications
800
700
600
500 VOL (V)
400
300 85C 25C 100 -40C
200
0 0.00 2.00 4.00 IOL (mA) 6.00 8.00 10.00
Figure 10-3. Typical VOL/IOL (VDD = 5.0 V)
800
700
600
500 VOL (V)
400
300
200
85C 25C
100
-40C
0 0.00 2.00 4.00 IOL (mA) 6.00 8.00 10.00
Figure 10-4. Typical VOL/IOL (VDD = 3.3 V)
Technical Data 102 Electrical Specifications MC68HC05J1A -- Rev. 3.0 MOTOROLA
Electrical Specifications 3.3-Volt DC Electrical Characteristics
4.000
3.500
3.000
2.500 IDD (mA)
2.000
1.500
5.5 V 4.5 V
1.000 3.6 V 0.500 2.4 V
0.000 0.00 0.50 1.00 1.50 2.00 2.50 BUS FREQUENCY (MHz) 3.00 3.50 4.00
Figure 10-5. Typical Operating IDD (25C)
2.500
2.000
1.500 IDD (mA)
5.5 V 1.000 4.5 V 3.6 V 0.500 2.4 V
0.000 0.00 1.00 2.00 3.00 BUS FREQUENCY (MHz) 4.00 5.00
Figure 10-6. Typical Wait Mode IDD (25C)
MC68HC05J1A -- Rev. 3.0 MOTOROLA Electrical Specifications
Technical Data 103
Electrical Specifications
10.0
1.0 FREQUENCY (MHz)
0.1
1.8 V 2.4 V 3.0 V 3.6 V 4.5 V 5.0 V 5.5 V
0.01 10 100 RESISTANCE (k) 1000
Figure 10-7. Typical Internal Operating Frequency for Various VDD at 25C -- RC Option Only
Technical Data 104 Electrical Specifications
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Electrical Specifications 5.0-Volt Control Timing
10.9 5.0-Volt Control Timing
Characteristic(1) Oscillator frequency Crystal/ceramic resonator mask option(2) RC oscillator mask option External clock mask option Internal operating frequency (fOSC / 2) Crystal oscillator Ceramic resonator RC oscillator External clock Cycle time (1 / fop) RESET pulse width low (edge-triggered) Timer resolution(3) IRQ interrupt pulse width low (edge-triggered) IRQ interrupt pulse period PA3-PA0 interrupt pulse width high (edge-triggered) PA3-PA0 interrupt pulse period OSC1 pulse width Symbol Min Max Unit
fOSC
-- dc --
4.2 4.2 4.2
MHz
fop
-- -- dc -- 476 1.5 4.0 125
(4)
2.1 2.1 2.1 2.1 -- -- -- -- -- -- -- --
MHz
tcyc tRL tRESL tILIH tILIL tIHIL tIHIH tOH, tOL
ns tcyc tcyc ns tcyc ns tcyc ns
125 (4) 200
1. V DD = 5.0 Vdc 10%; V SS = 0 Vdc; TA = TL to TH 2. Use only AT-cut crystals. 3. The 2-bit timer prescaler is the limiting factor in determining timer resolution. 4. The minimum period, tILIL or tIHIH, should not be less than the number of cycles required to execute the interrupt service routine plus 19 tcyc.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Electrical Specifications
Technical Data 105
Electrical Specifications 10.10 3.3-Volt Control Timing
Characteristic(1) Oscillator frequency Crystal/ceramic resonator mask option(2) RC oscillator mask option External clock mask option Internal operating frequency (fOSC / 2) Crystal oscillator Ceramic resonator RC oscillator External clock Cycle time (1 / fop) RESET pulse width low (edge-triggered) Timer resolution(3) IRQ interrupt pulse width low (edge-triggered) IRQ interrupt pulse period PA3-PA0 interrupt pulse width high (edge-triggered) PA3-PA0 interrupt pulse period OSC1 pulse width Symbol Min Max Unit
fOSC
-- dc --
2.0 2.0 2.0
MHz
fop
-- -- dc -- 1000 1.5 4.0 250
(4)
1.0 1.0 1.0 1.0 -- -- -- -- -- -- -- --
MHz
tcyc tRL tRESL tILIH tILIL tIHIL tIHIH tOH, tOL
ns tcyc tcyc ns tcyc ns tcyc ns
250 (4) 400
1. V DD = 3.3 Vdc 10%; V SS = 0 Vdc; TA = TL to TH 2. Use only AT-cut crystals. 3. The 2-bit timer prescaler is the limiting factor in determining timer resolution. 4. The minimum period, tILIL or tIHIH, should not be less than the number of cycles required to execute the interrupt service routine plus 19 tcyc.
Technical Data 106 Electrical Specifications
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Electrical Specifications 3.3-Volt Control Timing
tILIL IRQ PIN tILIH
IRQ1
. . .
tILIH
IRQn
IRQ (INTERNAL)
Figure 10-8. External Interrupt Timing
OSC (NOTE 1) tRL RESET tILIH IRQ (NOTE 2) 4064 tCYC IRQ (NOTE 3)
INTERNAL CLOCK
INTERNAL ADDRESS BUS
1FFE (NOTE 4)
1FFE
1FFE
1FFE
1FFE
1FFF
RESET OR INTERRUPT VECTOR FETCH Notes: 1. Internal clocking from OSC1 pin 2. Edge-triggered external interrupt mask option 3. Edge- and level-triggered external interrupt mask option 4. Reset vector shown as example
Figure 10-9. Stop Mode Recovery Timing
MC68HC05J1A -- Rev. 3.0 MOTOROLA Electrical Specifications
Technical Data 107
Electrical Specifications
VDD
(NOTE 1) 4064 tCYC
OSC1 PIN
INTERNAL CLOCK
INTERNAL ADDRESS BUS
1FFE
1FFE
1FFE
1FFE
1FFE
1FFE
1FFF
INTERNAL DATA BUS
NEW PCH
NEW PCL
Notes: 1. Power-on reset threshold is typically between 1 V and 2 V. 2. Internal clock, internal address bus, and internal data bus are not available externally.
Figure 10-10. Power-On Reset Timing
INTERNAL CLOCK
INTERNAL ADDRESS BUS
1FFE
1FFE
1FFE
1FFE
1FFF
NEW PC
NEW PC
INTERNAL DATA BUS tRL
NEW PCH
NEW PCL
DUMMY
OP CODE
Notes: 1. Internal clock, internal address bus, and internal data bus are not available externally. 2. The next rising edge of the internal clock after the rising edge of RESET initiates the reset sequence.
Figure 10-11. External Reset Timing
Technical Data 108 Electrical Specifications
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Technical Data -- MC68HC05J1A
Section 11. Mechanical Specifications
11.1 Contents
11.2 11.3 11.4 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 20-Pin Plastic Dual In-Line Package (PDIP). . . . . . . . . . . . . .110 20-Pin Small Outline Integrated Circuit Package (SOIC) . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
11.2 Introduction
Package dimensions for the MC68HC05J1A are provided in this section. The packages are: * * 20-pin plastic dual in-line package (PDIP) 20-pin small outline integrated circuit package (SOIC)
MC68HC05J1A -- Rev. 3.0 MOTOROLA Mechanical Specifications
Technical Data 109
Mechanical Specifications 11.3 20-Pin Plastic Dual In-Line Package (PDIP)
-A20 11 NOTES: 1. DIMENSIONING AND TOLERANCING PER ANSI Y14.5M, 1982. 2. CONTROLLING DIMENSION: INCH. 3. DIMENSION L TO CENTER OF LEAD WHEN FORMED PARALLEL. 4. DIMENSION B DOES NOT INCLUDE MOLD FLASH. DIM A B C D E F G J K L M N INCHES MIN MAX 1.010 1.070 0.240 0.260 0.150 0.180 0.015 0.022 0.050 BSC 0.050 0.070 0.100 BSC 0.008 0.015 0.110 0.140 0.300 BSC 0 15 0.020 0.040 MILLIMETERS MIN MAX 25.66 27.17 6.60 6.10 4.57 3.81 0.55 0.39 1.27 BSC 1.77 1.27 2.54 BSC 0.38 0.21 3.55 2.80 7.62 BSC 15 0 1.01 0.51
B
1 10
C
L
-TSEATING PLANE
K M E G F D 20 PL 0.25 (0.010)
M
N J 20 PL 0.25 (0.010) TA
M
M
TB
M
CASE 738-03
11.4 20-Pin Small Outline Integrated Circuit Package (SOIC)
-A16 9
-B-
8X
P 0.010 (0.25) M B M
1
8
J D 16X 0.010 (0.25) M TA S BS F R C -TG 14X K
SEATING PLANE MILLIMETERS X 45 DIM A B C D F G J K M P R MIN MAX 10.15 10.45 7.40 7.60 2.35 2.65 0.35 0.49 0.50 0.90 1.27 BSC 0.25 0.32 0.10 0.25 0 7 10.05 10.55 0.25 0.75 INCHES MIN MAX 0.400 0.411 0.292 0.299 0.093 0.104 0.014 0.019 0.020 0.035 0.050 BSC 0.010 0.012 0.004 0.009 0 7 0.395 0.415 0.010 0.029
M
CASE 751
Technical Data 110 Mechanical Specifications
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Technical Data -- MC68HC05J1A
Section 12. Ordering Information
12.1 Contents
12.2 12.3 12.4 12.5 12.6 12.7 12.8 12.9 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 MC Order Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111 MCU Ordering Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Application Program Media. . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Diskettes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 EPROMs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 ROM Program Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 ROM Verification Units (RVUs). . . . . . . . . . . . . . . . . . . . . . . . 115
12.2 Introduction
This section contains instructions for ordering custom-masked read-only memory (ROM) microcontroller units (MCU).
12.3 MC Order Numbers
Table 12-1. MC Order Numbers
Package Type Temperature Range 0C to 70C 20-pin dual in-line package -40C to 85C -40C to 105C 0C to 70C 20-pin small outline integrated circuit (SOIC) -40C to 85C -40C to 105C Order Number MC68HC05J1AP MC68HC05J1ACP MC68HC05J1AVP MC68HC05J1ADW MC68HC05J1ACDW MC68HC05J1AVDW
MC68HC05J1A -- Rev. 3.0 MOTOROLA Ordering Information
Technical Data 111
Ordering Information 12.4 MCU Ordering Forms
To initiate an order for a ROM-based MCU, first obtain the current ordering form for the MCU from a Motorola representative. Submit these items when ordering MCUs: * * * A current MCU ordering form that is completely filled out (Contact your Motorola sales office for assistance.) A copy of the customer specification if the customer specification deviates from the Motorola specification for the MCU Customer's application program on one of the media listed in 12.5 Application Program Media
The current MCU ordering form is also available through the World Wide Web at http://www.motorola.com/semiconductors/
12.5 Application Program Media
Deliver the application program to Motorola in one of these media: * * Macintosh(R)1 3 1/2-inch diskette (double-sided double-density 800 Kbytes or double-sided high-density 1.4 Mbytes) MS-DOS(R)2 or PC-DOS(R)3 3 1/2-inch diskette (double-sided double-density 720 Kbytes or double-sided high-density 1.44 Mbytes) MS-DOS(R) or PC-DOS(R) 5 1/4-inch diskette (double-sided double-density 360 Kbytes or double-sided high-density 1.2 Mbytes) Erasable, programmable read-only memory(s) (EPROM) 2716, 2732, 2764, 27128, 27256, or 27512 (depending on the size of the memory map of the MCU)
*
*
Use positive logic for data and addresses.
1. Macintosh is a registered trademark of Apple Computer, Inc. 2. MS-DOS is a registered trademark of Microsoft, Inc. 3. PC-DOS is a registered trademark of International Business Machines Corporation.
Technical Data 112 Ordering Information
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Ordering Information Diskettes
12.6 Diskettes
If submitting the application program on a diskette, clearly label the diskette with this information: * * * * * * * Customer name Customer part number Project or product name Filename of object code Date Name of operating system that formatted diskette Formatted capacity of diskette
On diskettes, the application program must be in Motorola's S-record format (S1 and S9 records), a character-based object file format generated by M6805 cross assemblers and linkers.
NOTE:
Begin the application program at the first user ROM location. Program addresses must correspond exactly to the available on-chip user ROM addresses as shown in the memory map. Write $00 in all non-user ROM locations or leave all non-user ROM locations blank. See the current MCU ordering form for additional requirements. If the memory map has two user ROM areas with the same addresses, then write the two areas in separate files on the diskette. Label the diskette with both filenames. In addition to the object code, a file containing the source code can be included. Motorola keeps this code confidential and uses it only to expedite ROM pattern generation in case of any difficulty with the object code. Label the diskette with the filename of the source code.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Ordering Information
Technical Data 113
Ordering Information 12.7 EPROMs
If submitting the application program in an EPROM, clearly label the EPROM with this information: * * * * * Customer name Customer part number Checksum Project or product name Date
NOTE:
Begin the application program at the first user ROM location. Program addresses must correspond exactly to the available on-chip user ROM addresses as shown in the memory map. Write $00 in all non-user ROM loctions. See the current MCU ordering form for additional requirements. Submit the application program in one EPROM large enough to contain the entire memory map. If the memory map has two user ROM areas with the same addresses, then write the two areas on separate EPROMs. Label the EPROMs with the addresses they contain. Pack EPROMs securely in a conductive IC carrier for shipment. Do not use Styrofoam(R)1.
12.8 ROM Program Verification
The primary use for the on-chip ROM is to hold the customer's application program. The customer develops and debugs the application program and then submits the MCU order along with the application program. Motorola inputs the customer's application program code into a computer program that generates a listing verify file. The listing verify file represents the memory map of the MCU. The listing verify file contains the user ROM code and may also contain non-user ROM code, such as self-check code. Motorola sends the customer a computer printout of the listing verify file along with a listing verify form.
1. Styrofoam is a registered trademark of The Dow Chemical Company.
Technical Data 114 Ordering Information
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Ordering Information ROM Verification Units (RVUs)
To aid the customer in checking the listing verify file, Motorola will program the listing verify file into customer-supplied blank EPROMs or preformatted Macintosh or DOS disks. All original pattern media are filed for contractual purposes and are not returned. Check the listing verify file thoroughly, then complete and sign the listing verify form and return the listing verify form to Motorola. The signed listing verify form constitutes the contractual agreement for the creation of the custom mask.
12.9 ROM Verification Units (RVUs)
After receiving the signed listing verify form, Motorola manufactures a custom photographic mask. The mask contains the customer's application program and is used to process silicon wafers. The application program cannot be changed after the manufacture of the mask begins. Motorola then produces ten MCUs, called RVUs, and sends the RVUs to the customer. RVUs are usually packaged in unmarked ceramic and tested to 5 Vdc at room temperature. RVUs are not tested to environmental extremes because their sole purpose is to demonstrate that the customer's user ROM pattern was properly implemented. The ten RVUs are free of charge with the minimum order quantity but are not production parts. RVUs are not guaranteed by Motorola Quality Assurance.
MC68HC05J1A -- Rev. 3.0 MOTOROLA Ordering Information
Technical Data 115
Ordering Information
Technical Data 116 Ordering Information
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Technical Data -- MC68HC05J1A
Appendix A. MC68HCL05J1A
A.1 Contents
A.2 A.3 A.4 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 DC Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . 118 MC Ordering Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
A.2 Introduction
This appendix introduces the MC68HCL05J1A, a low-power version of the MC68HC05J1A. All of the information in this document applies to the MC68HCL05J1A with the exceptions given in this appendix.
MC68HC05J1A -- Rev. 3.0 MOTOROLA MC68HCL05J1A
Technical Data 117
MC68HCL05J1A A.3 DC Electrical Characteristics
The data in 10.7 5.0-Volt DC Electrical Characteristics and 10.8 3.3-Volt DC Electrical Characteristics applies to the MC68HCL05J1A with the exceptions shown in Table A-1, Table A-2, Table A-3, and Table A-4. Table A-1. Low-Power Output Voltage (VDD = 1.8-2.4 Vdc)
Characteristic Output high voltage PA7-PA0, PB5-PB0 (ILoad = -0.1 mA) Output low voltage PA3-PA0 (ILoad = 0.2 mA) PA7-PA4 (ILoad = 2.0 mA) Symbol VOH Min VDD -0.3 Typ -- Max -- Unit V
VOL
-- --
-- --
0.3 0.3
V
Table A-2. Low-Power Output Voltage (VDD = 2.5-3.6 Vdc)
Characteristic Output high voltage PA7-PA0, PB5-PB0 (ILoad = -0.2 mA) Output low voltage PA3-PA0 (ILoad = 0.4 mA) PA7-PA4 (ILoad = 5.0 mA) Symbol VOH Min VDD -0.3 Typ -- Max -- Unit V
VOL
-- --
-- --
0.3 0.3
V
Technical Data 118 MC68HCL05J1A
MC68HC05J1A -- Rev. 3.0 MOTOROLA
MC68HCL05J1A
Table A-3. Low-Power Supply Current
Characteristic Supply current (VDD = 4.5-5.5 Vdc, fop = 2.1 MHz) Run(2) Wait(3) Stop(4) 25C 0C to 70C (standard) Supply current (VDD = 2.5-3.6 Vdc, fop = 1.0 MHz) Run(2) Wait(3) Stop(4) 25C 0C to 70C (standard) Supply current (VDD = 2.5-3.6 Vdc, fop = 500 kHz) Run(2) Wait(3) Stop(4) 25C 0C to 70C (standard) Supply current (VDD = 1.8-2.4 Vdc, fop = 500 kHz) Run(2) Wait(3) Stop(4) 25C 0C to 70C (standard) IDD -- -- -- -- 300 150 0.1 1.0 700 400 2 5 IDD -- -- -- -- 0.5 250 0.1 1.0 1.0 500 5.0 10.0 mA A A A A A A A IDD -- -- -- -- 1.0 0.5 0.1 1.0 2.0 1.0 5.0 10.0 mA mA A A IDD -- -- -- -- 3.0 1.6 0.2 2.0 4.0 2.5 10 20 mA mA A A Symbol Min Typ(1) Max Unit
1. Typical values reflect average measurements at midpoint of voltage range at 25C. 2. Run (operating) IDD measured using external square wave clock source with all inputs 0.2 V from rail. No dc loads. Less than 50 pF on all outputs. CL = 20 pF on OSC2. 3. WAIT IDD measured using external square wave clock source with all inputs 0.2 V from rail. No dc loads. Less than 50 pF on all outputs. C L = 20 pF on OSC2. All ports configured as inputs. VIL = 0.2 V, VIH = V DD -0.2 V. OSC2 capacitance linearly affects WAIT IDD. 4. Stop IDD measured with OSC1 = VDD. All ports configured as inputs. VIL = 0.2 V, VIH = V DD -0.2 V.
MC68HC05J1A -- Rev. 3.0 MOTOROLA MC68HCL05J1A
Technical Data 119
MC68HCL05J1A
Table A-4. Low-Power Pulldown Current
Characteristic Pulldown current (VDD = 4.5-5.5 Vdc, fop = 2.1 MHz) PA7-PA0, PB5-PB0 (pulldown device on) Pulldown current (VDD = 2.5-3.6 Vdc, fop = 1.0 MHz) PA7-PA0, PB5-PB0 (pulldown device on) Pulldown current (VDD = 2.5-3.6 Vdc, fop = 500 kHz) PA7-PA0, PB5-PB0 (pulldown device on) Pulldown current (VDD = 1.8-2.4 Vdc, fop = 500 kHz) PA7-PA0, PB5-PB0 (pulldown device on) Symbol IIL IIL IIL IIL Min 50 Typ(1) 100 Max 200 Unit A A A A
8
30
100
3
10
50
3
10
50
1. Typical values reflect average measurements at midpoint of voltage range at 25C.
2.0 1.8 1.6 1.4 1.2 RUN IDD (mA) 1.0 0.8 0.6 0.4 0.2 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 VDD = 2.5 V to 3.6 V VDD = 1.8 V to 2.4 V
INTERNAL CLOCK FREQUENCY (MHz)
Figure A-1. Maximum Run Mode IDD versus Frequency
Technical Data 120 MC68HCL05J1A
MC68HC05J1A -- Rev. 3.0 MOTOROLA
MC68HCL05J1A
1.0 0.9 0.8 0.7 WAIT IDD (mA) 0.6 0.5 0.4 0.3 0.2 0.1 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 VDD = 2.5 V to 3.6 V VDD = 1.8 V to 2.4 V
INTERNAL CLOCK FREQUENCY (MHz)
Figure A-2. Maximum Wait Mode IDD versus Frequency
A.4 MC Ordering Information
Table A-5 gives order numbers for the available package types. Table A-5. MC Order Numbers
Package Type 20-pin dual in-line package (DIP) 20-pin small outline integrated circuit (SOIC) Temperature Range 0C to 70C 0C to 70C Order Number MC68HCL05J1AP MC68HCL05J1ADW
MC68HC05J1A -- Rev. 3.0 MOTOROLA MC68HCL05J1A
Technical Data 121
MC68HCL05J1A
Technical Data 122 MC68HCL05J1A
MC68HC05J1A -- Rev. 3.0 MOTOROLA
Technical Data -- MC68HC05J1A
Appendix B. MC68HSC05J1A
B.1 Contents
B.2 B.3 B.4 B.5 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 DC Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . 124 Control Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 MC Ordering Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
B.2 Introduction
This appendix introduces the MC68HSC05J1A, a high-speed version of the MC68HC05J1A. All of the information in this document applies to the MC68HSC05J1A with the exceptions given in this appendix.
MC68HC05J1A -- Rev. 3.0 MOTOROLA MC68HSC05J1A
Technical Data 123
MC68HSC05J1A B.3 DC Electrical Characteristics
The data in 10.7 5.0-Volt DC Electrical Characteristics and 10.8 3.3-Volt DC Electrical Characteristics applies to the MC68HSC05J1A with the exceptions given in Table B-1. Table B-1. High-Speed Supply Current
Characteristic Supply current (VDD = 4.5-5.5 Vdc, fOP = 4.0 MHz) Run(2) Wait(3) Stop(4) 25C -40C to +85C Supply current (VDD = 3.0-3.6 Vdc, fOP = 2.1 MHz Run Wait Stop 25C -40C to +85C IDD -- -- -- -- -- -- -- -- 4.5 2.5 0.2 2.0 2.0 1.0 0.1 1.0 6.0 3.25 10 20 4.0 2.0 5.0 10 mA mA A A mA mA A A Symbol Min Typ(1) Max Unit
IDD
1. Typical values reflect average measurements at midpoint of voltage range at 25C. 2. Run (operating) IDD measured using external square wave clock source with all inputs 0.2 V from rail. No dc loads. Less than 50 pF on all outputs. CL = 20 pF on OSC2. 3. Wait IDD measured using external square wave clock source with all inputs 0.2 V from rail. No dc loads. Less than 50 pF on all outputs. C L = 20 pF on OSC2. All ports configured as inputs. VIL = 0.2 V, VIH = VDD -0.2 V. OSC2 capacitance linearly affects wait IDD. 4. Stop IDD measured with OSC1 = V DD. All ports configured as inputs. VIL = 0.2 V, VIH = VDD -0.2 V.
Technical Data 124 MC68HSC05J1A
MC68HC05J1A -- Rev. 3.0 MOTOROLA
MC68HSC05J1A
B.4 Control Timing
The data in 10.9 5.0-Volt Control Timing and 10.10 3.3-Volt Control Timing applies to the MC68HSC05J1A with the exceptions given in Table B-2 and Table B-3. Table B-2. High-Speed Control Timing (VDD = 5.0 V 10%)
Characteristic Oscillator frequency Crystal oscillator(1) Ceramic resonator External clock Internal operating frequency (fOSC / 2) Crystal oscillator(1) Ceramic resonator External clock Cycle time (1 / fOP) IRQ pulse width low (edge-triggered) PA3-PA0 interrupt pulse width (edge-triggered) OSC1 pulse width
1. Use only AT-cut crystals.
Symbol
Min -- -- -- -- -- -- 250 63 63 45
Max 8.0 8.0 8.0 4.0 4.0 4.0 -- -- -- --
Unit
fosc
MHz
fop
MHz
tcyc tILIL tIHIL tOH or tOL
ns ns ns ns
Table B-3. High-Speed Control Timing (VDD = 3.3 V 10%)
Characteristic Oscillator frequency Crystal oscillator(1) Ceramic resonator External clock Internal operating frequency (fOSC / 2) Crystal oscillator(1) Ceramic resonator External clock Cycle time (1 / fOP) IRQ pulse width low (edge-triggered) PA3-PA0 interrupt pulse width (edge-triggered) OSC1 pulse width
1. Use only AT-cut crystals.
Symbol
Min -- -- -- -- -- -- 480 125 125 90
Max 4.2 4.2 4.2 2.1 2.1 2.1
Unit
fosc
MHz
fop
MHz
tcyc tILIL tIHIL tOH or tOL
ns -- -- -- ns ns ns
MC68HC05J1A -- Rev. 3.0 MOTOROLA MC68HSC05J1A
Technical Data 125
MC68HSC05J1A B.5 MC Ordering Information
Table B-4 gives order numbers for the available package types. Table B-4. MC Order Numbers
Package Type 20-pin dual in-line package (DIP) 20-pin small outline integrated circuit (SOIC) Temperature Range 0C to 70C 0C to 70C Order Number MC68HSC05J1AP MC68HSC05J1ADW
Technical Data 126 MC68HSC05J1A
MC68HC05J1A -- Rev. 3.0 MOTOROLA
HOW TO REACH US: USA/EUROPE/LOCATIONS NOT LISTED: Motorola Literature Distribution; P.O. Box 5405, Denver, Colorado 80217 1-303-675-2140 or 1-800-441-2447 JAPAN: Motorola Japan Ltd.; SPS, Technical Information Center, 3-20-1, Minami-Azabu Minato-ku, Tokyo 106-8573 Japan 81-3-3440-3569 ASIA/PACIFIC: Motorola Semiconductors H.K. Ltd.; Silicon Harbour Centre, 2 Dai King Street, Tai Po Industrial Estate, Tai Po, N.T., Hong Kong 852-26668334 TECHNICAL INFORMATION CENTER: 1-800-521-6274 HOME PAGE: http://www.motorola.com/semiconductors
Information in this document is provided solely to enable system and software implementers to use Motorola products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document. Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Motorola assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. "Typical" parameters which may be provided in Motorola data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including "Typicals" must be validated for each customer application by customer's technical experts. Motorola does not convey any license under its patent rights nor the rights of others. Motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Motorola product could create a situation where personal injury or death may occur. Should Buyer purchase or use Motorola products for any such unintended or unauthorized application, Buyer shall indemnify and hold Motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Motorola was negligent regarding the design or manufacture of the part.
Motorola and the Stylized M Logo are registered in the U.S. Patent and Trademark Office. digital dna is a trademark of Motorola, Inc. All other product or service names are the property of their respective owners. Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer.
(c) Motorola, Inc. 2002
MC68HC05J1A/D


▲Up To Search▲   

 
Price & Availability of MC68HCL05J1A

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X